

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>on.corpora – classes for interpreting annotation &mdash; OntoNotes DB Tool 0.999b documentation</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '0.999b',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="OntoNotes DB Tool 0.999b documentation" href="index.html" />
    <link rel="up" title="API Reference" href="API_reference.html" />
    <link rel="next" title="on.tools – scripts for manipulating the ontonotes data" href="tools.html" />
    <link rel="prev" title="on.common – Utility and Logging Functions" href="common.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="tools.html" title="on.tools – scripts for manipulating the ontonotes data"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="common.html" title="on.common – Utility and Logging Functions"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">OntoNotes DB Tool 0.999b documentation</a> &raquo;</li>
          <li><a href="API_reference.html" accesskey="U">API Reference</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <span class="target" id="module-on.corpora"></span><div class="section" id="on-corpora-classes-for-interpreting-annotation">
<h1><a class="reference internal" href="#module-on.corpora" title="on.corpora"><tt class="xref py py-mod docutils literal"><span class="pre">on.corpora</span></tt></a> &#8211; classes for interpreting annotation<a class="headerlink" href="#on-corpora-classes-for-interpreting-annotation" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="on.corpora.subcorpus">
<em class="property">class </em><tt class="descclassname">on.corpora.</tt><tt class="descname">subcorpus</tt><big>(</big><em>a_ontonotes, physical_root_dir, cursor=None, prefix=[], suffix=[], lang=None, source=None, genre=None, strict_directory_structure=False, extensions=['parse', 'prop', 'sense', 'parallel', 'coref', 'name', 'speaker'], max_files='', old_id=''</em><big>)</big><a class="headerlink" href="#on.corpora.subcorpus" title="Permalink to this definition">¶</a></dt>
<dd><p>A subcorpus represents an arbitrary collection of documents.</p>
<p>Initializing</p>
<blockquote>
<div><p>The best way to deal with subcorpora is not to initialize them
yourself at all.  Create an ontonotes object with the config
file, then ask it about its subcorpora.  See <tt class="xref py py-class docutils literal"><span class="pre">on.ontonotes</span></tt> .</p>
<p>The following may be too much detail for your purposes.</p>
<p>When you <tt class="docutils literal"><span class="pre">__init__</span></tt> a subcorpus, that&#8217;s only telling it which
documents to include.  It doesn&#8217;t actually load any of them,
just makes a list.  The <a class="reference internal" href="#on.corpora.subcorpus.load_banks" title="on.corpora.subcorpus.load_banks"><tt class="xref py py-func docutils literal"><span class="pre">load_banks()</span></tt></a> method does the
actual file reading.</p>
<p>Which collection of documents a subcorpus represents depends
on how you load it. The main way to do this is to use the
constructor of <tt class="xref py py-class docutils literal"><span class="pre">on.ontonotes</span></tt> .</p>
<p>Loading the subcorpus directly through its constructor is complex,
but provides slightly more flexibility.  You need to first
determine how much you current directory structure matches the one
that ontonotes ships with.  If you left it in the format:</p>
<div class="highlight-bash"><div class="highlight"><pre>.../data/&lt;lang&gt;/annotations/&lt;genre&gt;/&lt;<span class="nb">source</span>&gt;/&lt;section&gt;/&lt;files&gt;
</pre></div>
</div>
<p>Then all you need to do is initialize <a class="reference internal" href="#on.corpora.subcorpus" title="on.corpora.subcorpus"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.subcorpus</span></tt></a>
with:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">a_subcorpus</span> <span class="o">=</span> <span class="n">on</span><span class="o">.</span><span class="n">corpora</span><span class="o">.</span><span class="n">subcorpus</span><span class="p">(</span><span class="n">a_ontonotes</span><span class="p">,</span> <span class="n">data_location</span><span class="p">)</span>
</pre></div>
</div>
<p>where <tt class="docutils literal"><span class="pre">data_location</span></tt> is as much of the data as you want to
load, perhaps <tt class="docutils literal"><span class="pre">.../data/english/annotations/nw/wsj/03</span></tt>.</p>
<p>If you&#8217;re not using the original directory structure, you need to
specify lang, genre, and source (ex: <tt class="docutils literal"><span class="pre">'english'</span></tt>, <tt class="docutils literal"><span class="pre">'nw'</span></tt>, and <tt class="docutils literal"><span class="pre">'wsj'</span></tt>)
so that ids can be correctly determined.</p>
<p>If you want to load some of the data under a directory node but
not all, prefix and suffix let you choose to load only some files.
All documents have a four digit numeric ID that identifies them
given their language, genre, and source.  As in, the document
<tt class="docutils literal"><span class="pre">.../data/english/annotations/nw/wsj/00/wsj_0012</span></tt> (which has
multiple files (<tt class="docutils literal"><span class="pre">.parse</span></tt>, <tt class="docutils literal"><span class="pre">.name</span></tt>, <tt class="docutils literal"><span class="pre">.sense</span></tt>, ...)) has id
0012.  Prefix and suffix are lists of strings that have to match
these IDs.  If you set prefix to [<tt class="docutils literal"><span class="pre">'0',</span> <span class="pre">'11',</span> <span class="pre">'313'</span></tt>] then the only
documents considered will be those with ids starting with <tt class="docutils literal"><span class="pre">'0',</span>
<span class="pre">'11'</span> <span class="pre">or</span> <span class="pre">'313'</span></tt>.  Similarly with suffix.  So:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">prefix</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;00&#39;</span><span class="p">,</span> <span class="s">&#39;01&#39;</span><span class="p">],</span> <span class="n">suffix</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;1&#39;</span><span class="p">,</span> <span class="s">&#39;2&#39;</span><span class="p">,</span> <span class="s">&#39;3&#39;</span><span class="p">,</span> <span class="s">&#39;4&#39;</span><span class="p">]</span>
</pre></div>
</div>
<p>means we&#8217;ll load (for <tt class="docutils literal"><span class="pre">cnn</span></tt>):</p>
<div class="highlight-bash"><div class="highlight"><pre>cnn_0001
cnn_0002
...
cnn_0004
cnn_0011
...
cnn_0094
cnn_0101
...
cnn_0194
</pre></div>
</div>
<p>but no files whose ids end not in 1, 2, 3, or 4 or whose ids
start with anything except &#8216;00&#8217; and &#8216;01&#8217;.</p>
</div></blockquote>
<p>Using</p>
<blockquote>
<div><p>A subcorpus that&#8217;s been fully initialized always contains a
treebank, and generally contains other banks.  To access a
bank you can use <tt class="docutils literal"><span class="pre">[]</span></tt> syntax.  For example, to access the
sense bank, you could do:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">a_sense_bank</span> <span class="o">=</span> <span class="n">a_subcorpus</span><span class="p">[</span><span class="s">&#39;sense&#39;</span><span class="p">]</span>
</pre></div>
</div>
<p>If you iterate over a subcorpus you get the names of all the
loaded banks in turn.  So you could do something like:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">for</span> <span class="n">a_bank_name</span><span class="p">,</span> <span class="n">a_bank</span> <span class="ow">in</span> <span class="n">a_subcorpus</span><span class="o">.</span><span class="n">iteritems</span><span class="p">():</span>
    <span class="k">print</span> <span class="s">&#39;I found a </span><span class="si">%s</span><span class="s"> bank and it had </span><span class="si">%d</span><span class="s"> </span><span class="si">%s</span><span class="s">_documents&#39;</span> <span class="o">%</span> <span class="p">(</span>
         <span class="n">a_bank_name</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">a_bank</span><span class="p">))</span>
</pre></div>
</div>
</div></blockquote>
<dl class="method">
<dt id="on.corpora.subcorpus.load_banks">
<tt class="descname">load_banks</tt><big>(</big><em>config</em><big>)</big><a class="headerlink" href="#on.corpora.subcorpus.load_banks" title="Permalink to this definition">¶</a></dt>
<dd><p>Load the individual bank data for the subcorpus to memory</p>
<p>Once a subcorpus is initialized we know what documents it
represent (as in cnn_0013) but we&#8217;ve not loaded the actual
files (as in cnn_0013.parse, cnn_0013.sense, ...).  We often
only want to load some of these, so specify which extensions
(prop, parse, coref) you want with the corpus.banks config
variable</p>
<p>This code will, for each bank, load the files and then enrich
the treebank with appropriate links.  For example, enriching
the treebank with sense data sets the
<a class="reference internal" href="#on.corpora.tree.tree.on_sense" title="on.corpora.tree.tree.on_sense"><tt class="xref py py-attr docutils literal"><span class="pre">on.corpora.tree.tree.on_sense</span></tt></a> attribute of every
tree leaf that&#8217;s been sense tagged.  Once all enrichment has
happened, one can go through the trees and be able to access
all the annotation.</p>
<p>(Minor exception: some name and coreference data is not
currently fully aligned with the tree and is inaccessible in
this manner)</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.subcorpus.write_to_db">
<tt class="descname">write_to_db</tt><big>(</big><em>a_cursor</em>, <em>only_these_banks=</em><span class="optional">[</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#on.corpora.subcorpus.write_to_db" title="Permalink to this definition">¶</a></dt>
<dd><p>Write the subcorpus and all files and banks within to the database.</p>
<p>Generally it&#8217;s better to use <tt class="xref py py-meth docutils literal"><span class="pre">on.ontonotes.write_to_db()</span></tt>
as that will write the type tables as well.  If you don&#8217;t,
perhaps for reasons of memory usage, write individual
subcorpora to the database, you need to call
<tt class="xref py py-func docutils literal"><span class="pre">on.ontonotes.write_type_tables_to_db()</span></tt> after the last time you
call <a class="reference internal" href="#on.corpora.subcorpus.write_to_db" title="on.corpora.subcorpus.write_to_db"><tt class="xref py py-func docutils literal"><span class="pre">write_to_db()</span></tt></a>.</p>
<dl class="docutils">
<dt>Parameters:</dt>
<dd><ul class="first last simple">
<li>a_cursor &#8211; The ouput of <tt class="xref py py-func docutils literal"><span class="pre">on.ontonotes.get_db_cursor()</span></tt></li>
<li>only_these_banks &#8211; if set, load only these extensions to the db</li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="on.corpora.subcorpus.copy">
<tt class="descname">copy</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.subcorpus.copy" title="Permalink to this definition">¶</a></dt>
<dd><p>make a duplicate of this subcorpus that represents the same documents</p>
<p>Note: if you had already loaded some banks these are absent in the copy.</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.subcorpus.backed_by">
<tt class="descname">backed_by</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.subcorpus.backed_by" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns either &#8216;db&#8217; or &#8216;fs&#8217;</p>
<p>We can be pulling our data from the database or the filesystem
depending on how we were created.  Note that even if we&#8217;re
reading from the file system, if the db is available we use it
for sense inventory and frame lookups.</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.subcorpus.__getitem__">
<tt class="descname">__getitem__</tt><big>(</big><em>key</em><big>)</big><a class="headerlink" href="#on.corpora.subcorpus.__getitem__" title="Permalink to this definition">¶</a></dt>
<dd><p>The standard way to access individual banks is with [] notation.</p>
<p>The keys are extensions.  To iterate over multiple banks in
parallel, do something like:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">for</span> <span class="n">a_tree_document</span><span class="p">,</span> <span class="n">a_sense_document</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">a_subcorpus</span><span class="p">[</span><span class="s">&#39;parse&#39;</span><span class="p">],</span> <span class="n">a_subcorpus</span><span class="p">[</span><span class="s">&#39;sense&#39;</span><span class="p">]):</span>
   <span class="k">pass</span>
</pre></div>
</div>
<p>Note that this will not work if some parses do not have sense documents.</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.subcorpus.all_banks">
<tt class="descname">all_banks</tt><big>(</big><em>standard_extension</em><big>)</big><a class="headerlink" href="#on.corpora.subcorpus.all_banks" title="Permalink to this definition">¶</a></dt>
<dd><p>The way to get a list of all banks of a type.</p>
<p>For example, if you have:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">cnn_0000</span><span class="o">.</span><span class="n">no_traces_parse</span>
<span class="n">cnn_0000</span><span class="o">.</span><span class="n">auto_traces_parse</span>
<span class="n">cnn_0000</span><span class="o">.</span><span class="n">parse</span>
</pre></div>
</div>
<p>If you want to iterate over all trees in all treebanks, you could do:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">for</span> <span class="n">a_treebank</span> <span class="ow">in</span> <span class="n">a_subcorpus</span><span class="o">.</span><span class="n">all_banks</span><span class="p">(</span><span class="s">&#39;parse&#39;</span><span class="p">):</span>
   <span class="k">for</span> <span class="n">a_tree_document</span> <span class="ow">in</span> <span class="n">a_treebank</span><span class="p">:</span>
      <span class="k">for</span> <span class="n">a_tree</span> <span class="ow">in</span> <span class="n">a_tree_document</span><span class="p">:</span>
         <span class="k">pass</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="on.corpora.subcorpus.get_unmapper">
<tt class="descname">get_unmapper</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.subcorpus.get_unmapper" title="Permalink to this definition">¶</a></dt>
<dd><p>a hash from ontonotes names back to original document names</p>
<p>For each language, in each genre directory, there is a file
<tt class="docutils literal"><span class="pre">map.txt</span></tt>.  For example:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>head data/english/annotations/bn/map.txt
abc/00/abc_0001 ABC20001001.1830.0973
abc/00/abc_0002 ABC20001005.1830.1532
abc/00/abc_0003 ABC20001006.1830.0060
abc/00/abc_0004 ABC20001006.1830.0205
abc/00/abc_0005 ABC20001010.1830.0037
abc/00/abc_0006 ABC20001010.1830.0410
abc/00/abc_0007 ABC20001013.1830.0041
abc/00/abc_0008 ABC20001013.1830.1496
abc/00/abc_0009 ABC20001015.1830.0224
abc/00/abc_0010 ABC20001015.1830.0659
</pre></div>
</div>
<p>These files map ontonotes names relative to the parent
directory of <tt class="docutils literal"><span class="pre">map.txt</span></tt> (<tt class="docutils literal"><span class="pre">bn</span></tt>, in this case) back to the
original document names.</p>
<p>This function finds the appropriate map.txt for this subcorpus
and parses it into a hash.</p>
<p>This only works if we read the subcorpus information from
disk.  The contents of <tt class="docutils literal"><span class="pre">map.txt</span></tt> are not available in the
database.</p>
<p>Sometimes there is a third column in map.txt.  This column
indicates, for sentence selected data, the character index in
the original document of the word selected for annotation.
The original documents are included in the metadata section,
under context.  This function ignores the third column.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="on.corpora.abstract_bank">
<em class="property">class </em><tt class="descclassname">on.corpora.</tt><tt class="descname">abstract_bank</tt><big>(</big><em>a_subcorpus</em>, <em>tag</em>, <em>extension</em><big>)</big><a class="headerlink" href="#on.corpora.abstract_bank" title="Permalink to this definition">¶</a></dt>
<dd><p>A superclass for all bank clsses</p>
<p>All banks support the following psuedocode usage:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">if</span> <span class="n">load_from_files</span><span class="p">:</span>
   <span class="n">a_something_bank</span> <span class="o">=</span> <span class="n">something_bank</span><span class="p">(</span><span class="n">a_subcorpus</span><span class="p">,</span> <span class="n">tag</span><span class="p">[,</span> <span class="n">optional</span> <span class="n">arguments</span><span class="p">])</span>
<span class="k">else</span><span class="p">:</span> <span class="c"># load from db</span>
   <span class="n">a_something_bank</span> <span class="o">=</span> <span class="n">something_bank</span><span class="o">.</span><span class="n">from_db</span><span class="p">(</span><span class="n">a_subcorpus</span><span class="p">,</span> <span class="n">tag</span><span class="p">,</span> <span class="n">a_cursor</span><span class="p">[,</span> <span class="n">optional</span> <span class="n">arguments</span><span class="p">])</span>

<span class="c"># only if a_something_bank is not a treebank</span>
<span class="n">a_something_bank</span><span class="o">.</span><span class="n">enrich_treebank</span><span class="p">(</span><span class="n">a_treebank</span><span class="p">[,</span> <span class="n">optional_arguments</span><span class="p">])</span>

<span class="k">for</span> <span class="n">a_something_document</span> <span class="ow">in</span> <span class="n">a_something_bank</span><span class="p">:</span>
   <span class="c"># get the corresponding somethingelse document</span>
   <span class="n">a_somethingelse_document</span> <span class="o">=</span> <span class="n">a_somethingelse_bank</span><span class="o">.</span><span class="n">get_document</span><span class="p">(</span><span class="n">a_something_document</span><span class="p">)</span>

<span class="k">if</span> <span class="n">write_to_files</span><span class="p">:</span>
   <span class="n">a_something_document</span><span class="o">.</span><span class="n">dump_view</span><span class="p">(</span><span class="n">a_cursor</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">out_dir</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span> <span class="c"># write to db</span>
   <span class="n">a_something_document</span><span class="o">.</span><span class="n">write_to_db</span><span class="p">(</span><span class="n">a_cursor</span><span class="p">)</span>


<span class="k">if</span> <span class="n">transfer_annotations_to_new_trees</span><span class="p">:</span>
   <span class="n">a_old_treebank</span> <span class="o">=</span> <span class="n">get_treebank</span><span class="p">()</span>
   <span class="n">a_old_sense_bank</span> <span class="o">=</span> <span class="n">get_sense_bank</span><span class="p">()</span>
   <span class="n">a_old_sense_bank</span><span class="o">.</span><span class="n">enrich_treebank</span><span class="p">(</span><span class="n">a_old_treebank</span><span class="p">)</span>

   <span class="n">a_new_treebank</span> <span class="o">=</span> <span class="n">get_treebank</span><span class="p">()</span>

   <span class="n">a_new_sense_bank</span> <span class="o">=</span> <span class="n">a_old_sense_bank</span><span class="o">.</span><span class="n">copy_to_different_trees</span><span class="p">(</span><span class="n">alignments</span><span class="p">,</span> <span class="n">a_new_treebank</span><span class="p">,</span> <span class="n">a_old_treebank</span><span class="p">)</span>
</pre></div>
</div>
<p>See:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.tree.treebank" title="on.corpora.tree.treebank"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.treebank</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.sense.sense_bank" title="on.corpora.sense.sense_bank"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.sense.sense_bank</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.proposition_bank" title="on.corpora.proposition.proposition_bank"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.proposition.proposition_bank</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.coreference.coreference_bank" title="on.corpora.coreference.coreference_bank"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.coreference.coreference_bank</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.name.name_bank" title="on.corpora.name.name_bank"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.name.name_bank</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.speaker.speaker_bank" title="on.corpora.speaker.speaker_bank"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.speaker.speaker_bank</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.parallel.parallel_bank" title="on.corpora.parallel.parallel_bank"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.parallel.parallel_bank</span></tt></a></li>
</ul>
</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="on.corpora.document_bank">
<em class="property">class </em><tt class="descclassname">on.corpora.</tt><tt class="descname">document_bank</tt><big>(</big><em>a_treebank</em>, <em>tag</em>, <em>lang_id</em>, <em>genre</em>, <em>source</em><big>)</big><a class="headerlink" href="#on.corpora.document_bank" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="class">
<dt id="on.corpora.file">
<em class="property">class </em><tt class="descclassname">on.corpora.</tt><tt class="descname">file</tt><big>(</big><em>base_dir</em>, <em>file_id</em>, <em>subcorpus_id</em><big>)</big><a class="headerlink" href="#on.corpora.file" title="Permalink to this definition">¶</a></dt>
<dd><p>A file.  Currently synonimous <a class="reference internal" href="#on.corpora.document" title="on.corpora.document"><tt class="xref py py-class docutils literal"><span class="pre">document</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.document">
<em class="property">class </em><tt class="descclassname">on.corpora.</tt><tt class="descname">document</tt><big>(</big><em>a_tree_document</em>, <em>lang_id</em>, <em>genre</em>, <em>source</em><big>)</big><a class="headerlink" href="#on.corpora.document" title="Permalink to this definition">¶</a></dt>
<dd><p>The text of a document.  In current usage there is only ever
one document per <a class="reference internal" href="#on.corpora.file" title="on.corpora.file"><tt class="xref py py-class docutils literal"><span class="pre">file</span></tt></a>, but there could in theory be more
than one.</p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.sentence">
<em class="property">class </em><tt class="descclassname">on.corpora.</tt><tt class="descname">sentence</tt><big>(</big><em>a_tree</em><big>)</big><a class="headerlink" href="#on.corpora.sentence" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents a sentence; a list of tokens.  Generally working
with <a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a> objects is easier.</p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.token">
<em class="property">class </em><tt class="descclassname">on.corpora.</tt><tt class="descname">token</tt><big>(</big><em>a_leaf</em><big>)</big><a class="headerlink" href="#on.corpora.token" title="Permalink to this definition">¶</a></dt>
<dd><p>A token.  Just a word and a part of speech</p>
</dd></dl>

<span class="target" id="module-on.corpora.tree"></span><div class="section" id="tree-syntactic-parse-annotation">
<h2><tt class="xref py py-mod docutils literal"><span class="pre">tree</span></tt> &#8211; Syntactic Parse Annotation<a class="headerlink" href="#tree-syntactic-parse-annotation" title="Permalink to this headline">¶</a></h2>
<p>See:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.tree.treebank" title="on.corpora.tree.treebank"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.treebank</span></tt></a></li>
</ul>
</div></blockquote>
<p>Correspondences:</p>
<blockquote>
<div><table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="39%" />
<col width="41%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head"><strong>Database Tables</strong></th>
<th class="head"><strong>Python Objects</strong></th>
<th class="head"><strong>File Elements</strong></th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">treebank</span></tt></td>
<td>treebank</td>
<td>All <tt class="docutils literal"><span class="pre">.parse</span></tt> files for a <a class="reference internal" href="#on.corpora.subcorpus" title="on.corpora.subcorpus"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.subcorpus</span></tt></a></td>
</tr>
<tr class="row-odd"><td>None</td>
<td>tree_document</td>
<td>A <tt class="docutils literal"><span class="pre">.parse</span></tt> file</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">tree</span></tt></td>
<td>tree</td>
<td>An S-expression in a <tt class="docutils literal"><span class="pre">.parse</span></tt> file</td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">syntactic_link</span></tt></td>
<td>syntactic_link</td>
<td>The numbers after &#8216;-&#8216; and &#8216;=&#8217; in trees</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">lemma</span></tt></td>
<td>lemma</td>
<td><tt class="docutils literal"><span class="pre">.lemma</span></tt> files (arabic only)</td>
</tr>
</tbody>
</table>
</div></blockquote>
<dl class="class">
<dt id="on.corpora.tree.treebank">
<em class="property">class </em><tt class="descclassname">on.corpora.tree.</tt><tt class="descname">treebank</tt><big>(</big><em>a_subcorpus</em>, <em>tag</em>, <em>cursor=None</em>, <em>extension='parse'</em>, <em>file_input_extension=None</em><big>)</big><a class="headerlink" href="#on.corpora.tree.treebank" title="Permalink to this definition">¶</a></dt>
<dd><p>The treebank class represents a collection of
<a class="reference internal" href="#on.corpora.tree.tree_document" title="on.corpora.tree.tree_document"><tt class="xref py py-class docutils literal"><span class="pre">tree_document</span></tt></a> classes and provides methods for
manipulating trees.  Further, because annotation in other banks
was generally done relative to these parse trees, much of the code
works relative to the trees.  For example, the
<a class="reference internal" href="#on.corpora.document" title="on.corpora.document"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.document</span></tt></a> data, their
<a class="reference internal" href="#on.corpora.sentence" title="on.corpora.sentence"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.sentence</span></tt></a> data, and their
<a class="reference internal" href="#on.corpora.token" title="on.corpora.token"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.token</span></tt></a> data are all derived from the trees.</p>
<p>Attributes:</p>
<blockquote>
<div><dl class="attribute">
<dt id="on.corpora.tree.treebank.banks">
<tt class="descname">banks</tt><a class="headerlink" href="#on.corpora.tree.treebank.banks" title="Permalink to this definition">¶</a></dt>
<dd><p>A hash from standard extensions (coref, name, ...) to bank instances</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="on.corpora.tree.tree_document">
<em class="property">class </em><tt class="descclassname">on.corpora.tree.</tt><tt class="descname">tree_document</tt><big>(</big><em>document_id</em>, <em>parse_list</em>, <em>sentence_id_list</em>, <em>headline_flag_list</em>, <em>paragraph_id_list</em>, <em>absolute_file_path</em>, <em>a_treebank</em>, <em>subcorpus_id</em>, <em>a_cursor=None</em>, <em>extension='parse'</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree_document" title="Permalink to this definition">¶</a></dt>
<dd><p>Contained by: <a class="reference internal" href="#on.corpora.tree.treebank" title="on.corpora.tree.treebank"><tt class="xref py py-class docutils literal"><span class="pre">treebank</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">tree</span></tt></a> (roots)</p>
<p>Attributes:</p>
<blockquote>
<div><p>The following two attributes are set during enrichment with
parallel banks.  For sentence level annotation, see
<a class="reference internal" href="#on.corpora.tree.tree.translations" title="on.corpora.tree.tree.translations"><tt class="xref py py-attr docutils literal"><span class="pre">tree.translations</span></tt></a> and <a class="reference internal" href="#on.corpora.tree.tree.originals" title="on.corpora.tree.tree.originals"><tt class="xref py py-attr docutils literal"><span class="pre">tree.originals</span></tt></a> .</p>
<dl class="attribute">
<dt id="on.corpora.tree.tree_document.translations">
<tt class="descname">translations</tt><a class="headerlink" href="#on.corpora.tree.tree_document.translations" title="Permalink to this definition">¶</a></dt>
<dd><p>A list of <a class="reference internal" href="#on.corpora.tree.tree_document" title="on.corpora.tree.tree_document"><tt class="xref py py-class docutils literal"><span class="pre">tree_document</span></tt></a> instances in other subcorpora
that represent translations of this document</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree_document.original">
<tt class="descname">original</tt><a class="headerlink" href="#on.corpora.tree.tree_document.original" title="Permalink to this definition">¶</a></dt>
<dd><p>A single <a class="reference internal" href="#on.corpora.tree.tree_document" title="on.corpora.tree.tree_document"><tt class="xref py py-class docutils literal"><span class="pre">tree_document</span></tt></a> instance representing the
original document that this one was translated from.  It doesn&#8217;t
make sense to have more than one of these.</p>
</dd></dl>

</div></blockquote>
<p>Methods:</p>
<blockquote>
<div><dl class="method">
<dt id="on.corpora.tree.tree_document.align_to">
<tt class="descname">align_to</tt><big>(</big><em>another_tree_document</em>, <em>map_differences=True</em>, <em>alignment_mode='auto'</em>, <em>junk_character=None</em>, <em>junk_leaf=None</em>, <em>smart_map_traces=True</em>, <em>trace_statistics_callback=None</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree_document.align_to" title="Permalink to this definition">¶</a></dt>
<dd><p>given another tree document, return a hash to lists of
leaves in that tree document from leaves in this tree
document:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span> <span class="n">leaf</span><span class="p">(</span><span class="n">pro</span><span class="o">-</span><span class="n">wal</span><span class="o">-</span><span class="n">mart</span><span class="p">)</span> <span class="p">:</span> <span class="p">[</span> <span class="n">leaf</span><span class="p">(</span><span class="n">pro</span><span class="p">),</span> <span class="n">leaf</span><span class="p">(</span><span class="o">-</span><span class="p">),</span> <span class="n">leaf</span><span class="p">(</span><span class="n">wal</span><span class="o">-</span><span class="n">mart</span><span class="p">)],</span> <span class="o">...</span> <span class="p">}</span>
</pre></div>
</div>
<p>or in the other direction:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span> <span class="n">leaf</span><span class="p">(</span><span class="n">pro</span><span class="p">)</span>      <span class="p">:</span> <span class="p">[</span> <span class="n">leaf</span><span class="p">(</span><span class="n">pro</span><span class="o">-</span><span class="n">wal</span><span class="o">-</span><span class="n">mart</span><span class="p">)</span> <span class="p">],</span>
  <span class="n">leaf</span><span class="p">(</span><span class="o">-</span><span class="p">)</span>        <span class="p">:</span> <span class="p">[</span> <span class="n">leaf</span><span class="p">(</span><span class="n">pro</span><span class="o">-</span><span class="n">wal</span><span class="o">-</span><span class="n">mart</span><span class="p">)</span> <span class="p">],</span>
  <span class="n">leaf</span><span class="p">(</span><span class="n">wal</span><span class="o">-</span><span class="n">mart</span><span class="p">)</span> <span class="p">:</span> <span class="p">[</span> <span class="n">leaf</span><span class="p">(</span><span class="n">pro</span><span class="o">-</span><span class="n">wal</span><span class="o">-</span><span class="n">mart</span><span class="p">)</span> <span class="p">]</span> <span class="p">}</span>
</pre></div>
</div>
<p>Traces are mapped too.  If &#8216;smart_map_traces&#8217; is False,
they&#8217;re dealt with just like any other tokens.  This causes
some problems, though, so if &#8216;smart_map_traces&#8217; is True then
we first align the non-trace tokens, then come back and align
the trace tokens.</p>
<p>Can deal with some misalignments, but is not sentient.</p>
<p>If map_differences is true, a change from &#8216; e &#8216; to &#8216; a &#8216;, for
example, will be included in the mapping.  Otherwise, it&#8217;s
dropped.</p>
<p>Alignment mode may be either &#8216;character&#8217; or &#8216;token&#8217;.  If the
former, diff_align is run at the character level, otherwise it
is run at the space-separated token level.  The former will
map more small changes, the latter is more robust.  If set to
&#8216;auto&#8217;, then &#8216;token&#8217; mode will be used for chinese while
&#8216;character&#8217; mode will be used for all other languages.  There
is one exception: if the documents are <em>exactly</em> the same with
the exception of traces, then &#8216;token&#8217; mode is used when &#8216;auto&#8217;
is specified this is because in this circumstance we know we
don&#8217;t need the mapping small changes ability of character
level mapping.</p>
<p>Set junk_X to functions of one argument returning a boolean.
If they are set, they will be called for each character / leaf
and alignment will only be done with the ones for which they
return negative.</p>
<p>Set trace_statistics_callback to a function of three arguments
if you want to get stats.  For example:</p>
<blockquote>
<div>trace_statistics_callback(&#8216;all&#8217;, &#8216;totals&#8217;, &#8216;gold&#8217;)
trace_statistics_callback(&#8216;argument&#8217;, &#8216;totals&#8217;, &#8216;gold&#8217;)</div></blockquote>
<p>If unset the function is ignored.  The first argument of the
call with be &#8216;all&#8217; for data on all traces, &#8216;argument&#8217; for data
on argument bearing traces only, or &#8216;error&#8217; for alignment
errors.</p>
<p>For non-errors, the possible second and third arguments are called for:</p>
<blockquote>
<div>&#8216;totals&#8217;, &#8216;gold&#8217;: each trace in the from tree
&#8216;totals&#8217;, &#8216;auto&#8217;: each trace in the to tree
&#8216;primary&#8217;, &#8216;deleted&#8217;: each trace in the from tree that&#8217;s not in the to tree
&#8216;primary&#8217;, &#8216;inserted&#8217;: each trace in the to tree that&#8217;s not in the from tree
&#8216;primary&#8217;, &#8216;correct&#8217;: each trace that&#8217;s the same in the two trees
&#8216;primary&#8217;, &#8216;incorrect indexing&#8217;: each trace that has ...
&#8216;primary&#8217;, &#8216;incorrect target&#8217;: each trace that has ...
&#8216;primary&#8217;, &#8216;incorrect type&#8217;: each trace that has ...
&#8216;primary&#8217;, &#8216;incorrect type indexing&#8217;: each trace that has ...
&#8216;primary&#8217;, &#8216;incorrect type target&#8217;: each trace that has ...
&#8216;secondary&#8217;, various other stats</div></blockquote>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree_document.sentence_tokens_as_lists">
<tt class="descname">sentence_tokens_as_lists</tt><big>(</big><em>make_sgml_safe=False</em>, <em>strip_traces=False</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree_document.sentence_tokens_as_lists" title="Permalink to this definition">¶</a></dt>
<dd><p>all the words in this document broken into lists by sentence</p>
<p>So &#8216;Good morning.  My name is John.&#8217; becomes:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">[[</span><span class="s">&#39;Good&#39;</span><span class="p">,</span> <span class="s">&#39;morning&#39;</span><span class="p">,</span> <span class="s">&#39;.&#39;</span><span class="p">],</span>
 <span class="p">[</span><span class="s">&#39;My&#39;</span><span class="p">,</span> <span class="s">&#39;name&#39;</span><span class="p">,</span> <span class="s">&#39;is&#39;</span><span class="p">,</span> <span class="s">&#39;john&#39;</span><span class="p">,</span> <span class="s">&#39;.&#39;</span><span class="p">]]</span>
</pre></div>
</div>
<p>This doesn&#8217;t actually return a list, but instead a generator.
To get this as a (very large) list of lists, just call it as
<tt class="docutils literal"><span class="pre">list(a_tree_document.sentence_tokens_as_lists())</span></tt></p>
<p>If &#8216;make_sgml_safe&#8217; is True, <a class="reference internal" href="common.html#on.common.util.make_sgml_safe" title="on.common.util.make_sgml_safe"><tt class="xref py py-func docutils literal"><span class="pre">on.common.util.make_sgml_safe()</span></tt></a>
is called for each word.</p>
<p>If &#8216;strip_traces&#8217; is True, trace leaves are not included in the output.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="on.corpora.tree.tree">
<em class="property">class </em><tt class="descclassname">on.corpora.tree.</tt><tt class="descname">tree</tt><big>(</big><em>tag</em>, <em>word=None</em>, <em>document_tag='gold'</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree" title="Permalink to this definition">¶</a></dt>
<dd><p>root trees, internal nodes, and leaves are all trees.</p>
<p>Contained by: <a class="reference internal" href="#on.corpora.tree.tree_document" title="on.corpora.tree.tree_document"><tt class="xref py py-class docutils literal"><span class="pre">tree_document</span></tt></a> if a root tree, <a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">tree</span></tt></a> otherwise
Contains: None if a leaf, <a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">tree</span></tt></a> otherwise</p>
<p>Attributes:</p>
<blockquote>
<div><p>Always available:</p>
<blockquote>
<div><dl class="attribute">
<dt id="on.corpora.tree.tree.parent">
<tt class="descname">parent</tt><a class="headerlink" href="#on.corpora.tree.tree.parent" title="Permalink to this definition">¶</a></dt>
<dd><p>The parent of this tree.  If None then we are the root</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.lemma">
<tt class="descname">lemma</tt><a class="headerlink" href="#on.corpora.tree.tree.lemma" title="Permalink to this definition">¶</a></dt>
<dd><p>Applicable only to Arabic leaves.  The morphological lemma of
the word as a string.  In Chinese the word is the lemma, so use
<a class="reference internal" href="#on.corpora.tree.tree.word" title="on.corpora.tree.tree.word"><tt class="xref py py-attr docutils literal"><span class="pre">word</span></tt></a>.  In English the best you can do is use either the
<a class="reference internal" href="#on.corpora.sense.on_sense.lemma" title="on.corpora.sense.on_sense.lemma"><tt class="xref py py-attr docutils literal"><span class="pre">lemma</span></tt></a> attribute of
<a class="reference internal" href="#on.corpora.tree.tree.on_sense" title="on.corpora.tree.tree.on_sense"><tt class="xref py py-attr docutils literal"><span class="pre">on_sense</span></tt></a> or the
<a class="reference internal" href="#on.corpora.proposition.proposition.lemma" title="on.corpora.proposition.proposition.lemma"><tt class="xref py py-attr docutils literal"><span class="pre">lemma</span></tt></a> attribute of
<a class="reference internal" href="#on.corpora.tree.tree.proposition" title="on.corpora.tree.tree.proposition"><tt class="xref py py-attr docutils literal"><span class="pre">proposition</span></tt></a> .</p>
<p>See Also: <a class="reference internal" href="#on.corpora.tree.tree.lemma_object" title="on.corpora.tree.tree.lemma_object"><tt class="xref py py-attr docutils literal"><span class="pre">lemma_object</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.lemma_object">
<tt class="descname">lemma_object</tt><a class="headerlink" href="#on.corpora.tree.tree.lemma_object" title="Permalink to this definition">¶</a></dt>
<dd><p>Applicable only to Arabic leaves.  There is a lot more
information in the <tt class="docutils literal"><span class="pre">.lemma</span></tt> file for each leaf than just the
lemma string, so if available a <a class="reference internal" href="#on.corpora.tree.lemma" title="on.corpora.tree.lemma"><tt class="xref py py-class docutils literal"><span class="pre">lemma</span></tt></a> instance is here.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.word">
<tt class="descname">word</tt><a class="headerlink" href="#on.corpora.tree.tree.word" title="Permalink to this definition">¶</a></dt>
<dd><p>Applicable only to leaves.  The word of text corresponding to the
leaf.  To extract all the words for a tree, see
<a class="reference internal" href="#on.corpora.tree.tree.get_word_string" title="on.corpora.tree.tree.get_word_string"><tt class="xref py py-meth docutils literal"><span class="pre">get_word_string()</span></tt></a> .</p>
<p>For arabic, the word of a tree is always the vocalized
unicode representation.  For other representations, see
the <a class="reference internal" href="#on.corpora.tree.tree.get_word" title="on.corpora.tree.tree.get_word"><tt class="xref py py-meth docutils literal"><span class="pre">get_word()</span></tt></a> method.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.tag">
<tt class="descname">tag</tt><a class="headerlink" href="#on.corpora.tree.tree.tag" title="Permalink to this definition">¶</a></dt>
<dd><p>Every node in the tree has a <a class="reference internal" href="#on.corpora.tree.tree.tag" title="on.corpora.tree.tree.tag"><tt class="xref py py-attr docutils literal"><span class="pre">tag</span></tt></a>, which represents part
of speech, phrase type, or function type information.  For
example, the leaf <tt class="docutils literal"><span class="pre">(NNS</span> <span class="pre">cabbages)</span></tt> has a tag of <tt class="docutils literal"><span class="pre">NNS</span></tt> while
the subtree <tt class="docutils literal"><span class="pre">(NP</span> <span class="pre">(NNS</span> <span class="pre">cabbages))</span></tt> has a tag of <tt class="docutils literal"><span class="pre">NP</span></tt>.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.children">
<tt class="descname">children</tt><a class="headerlink" href="#on.corpora.tree.tree.children" title="Permalink to this definition">¶</a></dt>
<dd><p>A list of the child nodes of this tree.  For leaves this will be
the empty list.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.reference_leaves">
<tt class="descname">reference_leaves</tt><a class="headerlink" href="#on.corpora.tree.tree.reference_leaves" title="Permalink to this definition">¶</a></dt>
<dd><p>A list of trace leaves in this tree that point to this subtree</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.identity_subtree">
<tt class="descname">identity_subtree</tt><a class="headerlink" href="#on.corpora.tree.tree.identity_subtree" title="Permalink to this definition">¶</a></dt>
<dd><p>The subtree in this tree that this trace leaf points to</p>
</dd></dl>

</div></blockquote>
<p>Available only after enrichment:</p>
<blockquote>
<div><p>The following attributes represent the annotation.  They are set
during the enrichment process, which happens automatically unless
you are invoking things manually at a low level.  You must, of
course, specify that a bank is to be loaded for its annotations to
be available.  For example, if the configuration
variable <tt class="docutils literal"><span class="pre">corpora.banks</span></tt> is set to <tt class="docutils literal"><span class="pre">&quot;parse</span> <span class="pre">sense&quot;</span></tt>, then leaves
will have <a class="reference internal" href="#on.corpora.tree.tree.on_sense" title="on.corpora.tree.tree.on_sense"><tt class="xref py py-attr docutils literal"><span class="pre">on_sense</span></tt></a> attributes but not <a class="reference internal" href="#on.corpora.tree.tree.proposition" title="on.corpora.tree.tree.proposition"><tt class="xref py py-attr docutils literal"><span class="pre">proposition</span></tt></a>
attributes.</p>
<p>Each annotation variable specifies it&#8217;s level, the bank that sets
it, and the class whose instance it is set to.  Leaf level
annotation applies only to leaves, tree level annotation only to
sentences, and subtree annotation to any subtree in between,
including leaves.</p>
<p>Order is not significant in any of the lists.</p>
<dl class="attribute">
<dt id="on.corpora.tree.tree.on_sense">
<tt class="descname">on_sense</tt><a class="headerlink" href="#on.corpora.tree.tree.on_sense" title="Permalink to this definition">¶</a></dt>
<dd><p>Leaf level, sense bank, <a class="reference internal" href="#on.corpora.sense.on_sense" title="on.corpora.sense.on_sense"><tt class="xref py py-class docutils literal"><span class="pre">on_sense</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.proposition">
<tt class="descname">proposition</tt><a class="headerlink" href="#on.corpora.tree.tree.proposition" title="Permalink to this definition">¶</a></dt>
<dd><p>Subtree level, proposition bank, <a class="reference internal" href="#on.corpora.proposition.proposition" title="on.corpora.proposition.proposition"><tt class="xref py py-class docutils literal"><span class="pre">proposition</span></tt></a></p>
<p>This is attached to the same subtree as the primary predicate
node of the proposition.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.predicate_node_list">
<tt class="descname">predicate_node_list</tt><a class="headerlink" href="#on.corpora.tree.tree.predicate_node_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Subtree level, proposition bank, list of
<a class="reference internal" href="#on.corpora.proposition.predicate_node" title="on.corpora.proposition.predicate_node"><tt class="xref py py-class docutils literal"><span class="pre">predicate_node</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.argument_node_list">
<tt class="descname">argument_node_list</tt><a class="headerlink" href="#on.corpora.tree.tree.argument_node_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Subtree level, proposition bank, list of
<a class="reference internal" href="#on.corpora.proposition.argument_node" title="on.corpora.proposition.argument_node"><tt class="xref py py-class docutils literal"><span class="pre">argument_node</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.link_node_list">
<tt class="descname">link_node_list</tt><a class="headerlink" href="#on.corpora.tree.tree.link_node_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Subtree level, proposition bank, list of
<a class="reference internal" href="#on.corpora.proposition.link_node" title="on.corpora.proposition.link_node"><tt class="xref py py-class docutils literal"><span class="pre">link_node</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.named_entity">
<tt class="descname">named_entity</tt><a class="headerlink" href="#on.corpora.tree.tree.named_entity" title="Permalink to this definition">¶</a></dt>
<dd><p>Subtree level, name bank, <a class="reference internal" href="#on.corpora.name.name_entity" title="on.corpora.name.name_entity"><tt class="xref py py-class docutils literal"><span class="pre">name_entity</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.start_named_entity_list">
<tt class="descname">start_named_entity_list</tt><a class="headerlink" href="#on.corpora.tree.tree.start_named_entity_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Leaf level, name bank, list of <a class="reference internal" href="#on.corpora.name.name_entity" title="on.corpora.name.name_entity"><tt class="xref py py-class docutils literal"><span class="pre">name_entity</span></tt></a></p>
<p>Name entities whose initial word is this leaf.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.end_named_entity_list">
<tt class="descname">end_named_entity_list</tt><a class="headerlink" href="#on.corpora.tree.tree.end_named_entity_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Leaf level, name bank, list of <a class="reference internal" href="#on.corpora.name.name_entity" title="on.corpora.name.name_entity"><tt class="xref py py-class docutils literal"><span class="pre">name_entity</span></tt></a></p>
<p>Name entities whose final word is this leaf.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.coreference_link">
<tt class="descname">coreference_link</tt><a class="headerlink" href="#on.corpora.tree.tree.coreference_link" title="Permalink to this definition">¶</a></dt>
<dd><p>Subtree level, coreference bank,
<a class="reference internal" href="#on.corpora.coreference.coreference_link" title="on.corpora.coreference.coreference_link"><tt class="xref py py-class docutils literal"><span class="pre">coreference_link</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.coreference_chain">
<tt class="descname">coreference_chain</tt><a class="headerlink" href="#on.corpora.tree.tree.coreference_chain" title="Permalink to this definition">¶</a></dt>
<dd><p>Subtree level, coreference bank,
<a class="reference internal" href="#on.corpora.coreference.coreference_chain" title="on.corpora.coreference.coreference_chain"><tt class="xref py py-class docutils literal"><span class="pre">coreference_chain</span></tt></a></p>
<p>The coreference chain that <a class="reference internal" href="#on.corpora.tree.tree.coreference_link" title="on.corpora.tree.tree.coreference_link"><tt class="xref py py-attr docutils literal"><span class="pre">coreference_link</span></tt></a> belongs to.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.start_coreference_link_list">
<tt class="descname">start_coreference_link_list</tt><a class="headerlink" href="#on.corpora.tree.tree.start_coreference_link_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Leaf level, coreference bank, list of
<a class="reference internal" href="#on.corpora.coreference.coreference_link" title="on.corpora.coreference.coreference_link"><tt class="xref py py-class docutils literal"><span class="pre">coreference_link</span></tt></a></p>
<p>Coreference links whose initial word is this leaf.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.end_coreference_link_list">
<tt class="descname">end_coreference_link_list</tt><a class="headerlink" href="#on.corpora.tree.tree.end_coreference_link_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Leaf level, coreference bank, list of
<a class="reference internal" href="#on.corpora.coreference.coreference_link" title="on.corpora.coreference.coreference_link"><tt class="xref py py-class docutils literal"><span class="pre">coreference_link</span></tt></a></p>
<p>Coreference links whose final word is this leaf.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.coref_section">
<tt class="descname">coref_section</tt><a class="headerlink" href="#on.corpora.tree.tree.coref_section" title="Permalink to this definition">¶</a></dt>
<dd><p>Tree level, coreference bank, <tt class="docutils literal"><span class="pre">string</span></tt></p>
<p>The Broadcast Conversation documents, because they are
very long, were divided into sections for coreference
annotation.  We tried to break them up at natural
places, those where the show changed topic, to minimize
the chance of cross-section coreference.  The annotators
then did standard coreference annotation on each section
separately as if it were its own document.  Post
annotation, we merged all sections into one <tt class="docutils literal"><span class="pre">.coref</span></tt>
file, with each section as a <tt class="docutils literal"><span class="pre">TEXT</span></tt> span.  So you can
have a pair of references to John Smith in section 1 and
another pair of references in section 2, but they form
two separate chains.  That is, every coreference chain
is within only one coreference section.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.translations">
<tt class="descname">translations</tt><a class="headerlink" href="#on.corpora.tree.tree.translations" title="Permalink to this definition">¶</a></dt>
<dd><p>Tree level, parallel_bank, list of <a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">tree</span></tt></a></p>
<p>Trees (in other subcorpora) that are translations of this tree</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.originals">
<tt class="descname">originals</tt><a class="headerlink" href="#on.corpora.tree.tree.originals" title="Permalink to this definition">¶</a></dt>
<dd><p>Tree level, parallel_bank, list of <a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">tree</span></tt></a></p>
<p>Trees (in other subcorpora) that are originals of this tree</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.tree.tree.speaker_sentence">
<tt class="descname">speaker_sentence</tt><a class="headerlink" href="#on.corpora.tree.tree.speaker_sentence" title="Permalink to this definition">¶</a></dt>
<dd><p>Tree level, speaker bank,
<a class="reference internal" href="#on.corpora.speaker.speaker_sentence" title="on.corpora.speaker.speaker_sentence"><tt class="xref py py-class docutils literal"><span class="pre">speaker_sentence</span></tt></a></p>
</dd></dl>

</div></blockquote>
</div></blockquote>
<p>Methods:</p>
<blockquote>
<div><dl class="method">
<dt id="on.corpora.tree.tree.is_noun">
<tt class="descname">is_noun</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.is_noun" title="Permalink to this definition">¶</a></dt>
<dd><p>Is the part of speech of this leaf NN or NNS assuming the Penn Treebank&#8217;s tagset?</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.is_verb">
<tt class="descname">is_verb</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.is_verb" title="Permalink to this definition">¶</a></dt>
<dd><p>Is the part of speech of this leaf VN or VBX for some X assuming the Penn Treebank&#8217;s tagset?</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.is_aux">
<tt class="descname">is_aux</tt><big>(</big><em>prop=False</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.is_aux" title="Permalink to this definition">¶</a></dt>
<dd><p>Does this leaf represent an auxilliary verb ?</p>
<p>Note: only makes sense if english</p>
<p>All we do is say that a leaf is auxilliary if:</p>
<blockquote>
<div><ul class="simple">
<li>it is a verb</li>
<li>the next leaf (skipping adverbs) is also a verb</li>
</ul>
</div></blockquote>
<p>This does not deal with all cases.  For example, in the
sentence &#8216;Have you eaten breakfast?&#8217;, the initial &#8216;have&#8217; is an
auxilliary verb, but we report it as not so. There should be
no false positives, but we don&#8217;t get all the cases.</p>
<p>If the argument &#8216;prop&#8217; is true, then we use a less restrictive
definition of auxilliary that represents closer what is legal
for proptaggers to tag.  That is, if we have a verb following
a verb, and the second verb is under an NP, don&#8217;t count the
first verb as aux.</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.is_leaf">
<tt class="descname">is_leaf</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.is_leaf" title="Permalink to this definition">¶</a></dt>
<dd><p>does this tree node represent a leaf?</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.is_trace">
<tt class="descname">is_trace</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.is_trace" title="Permalink to this definition">¶</a></dt>
<dd><p>does this tree node represent a trace?</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.is_root">
<tt class="descname">is_root</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.is_root" title="Permalink to this definition">¶</a></dt>
<dd><p>check whether the tree is a root</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.is_punct">
<tt class="descname">is_punct</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.is_punct" title="Permalink to this definition">¶</a></dt>
<dd><p>is this leaf punctuation?</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.is_conj">
<tt class="descname">is_conj</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.is_conj" title="Permalink to this definition">¶</a></dt>
<dd><p>is this leaf a conjunction?</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.is_trace_indexed">
<tt class="descname">is_trace_indexed</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.is_trace_indexed" title="Permalink to this definition">¶</a></dt>
<dd><p>if we&#8217;re a trace, do we have a defined reference index?</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.is_trace_origin">
<tt class="descname">is_trace_origin</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.is_trace_origin" title="Permalink to this definition">¶</a></dt>
<dd><p>if we&#8217;re a trace, do we have a defined identity index?</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.get_root">
<tt class="descname">get_root</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.get_root" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the root of this tree, which may be ourself.</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.get_subtree">
<tt class="descname">get_subtree</tt><big>(</big><em>a_id</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.get_subtree" title="Permalink to this definition">¶</a></dt>
<dd><p>return the subtree with the specified id</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.get_leaf_by_word_index">
<tt class="descname">get_leaf_by_word_index</tt><big>(</big><em>a_word_index</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.get_leaf_by_word_index" title="Permalink to this definition">¶</a></dt>
<dd><p>given a word index, return the leaf at that index</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.get_leaf_by_token_index">
<tt class="descname">get_leaf_by_token_index</tt><big>(</big><em>a_token_index</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.get_leaf_by_token_index" title="Permalink to this definition">¶</a></dt>
<dd><p>given a token index, return the leaf at that index</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.get_subtree_by_span">
<tt class="descname">get_subtree_by_span</tt><big>(</big><em>start</em>, <em>end</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.get_subtree_by_span" title="Permalink to this definition">¶</a></dt>
<dd><p>given start and end of a span, return the highest subtree that represents it</p>
<p>The arguments <tt class="docutils literal"><span class="pre">start</span></tt> and <tt class="docutils literal"><span class="pre">end</span></tt> may either be leaves or token indecies.</p>
<p>Returns <tt class="docutils literal"><span class="pre">None</span></tt> if there is no matching subtree.</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.pretty_print">
<tt class="descname">pretty_print</tt><big>(</big><em>offset=''</em>, <em>buckwalter=False</em>, <em>vocalized=True</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.pretty_print" title="Permalink to this definition">¶</a></dt>
<dd><p>return a string representing this tree in a human readable format</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.get_word">
<tt class="descname">get_word</tt><big>(</big><em>buckwalter=False</em>, <em>vocalized=True</em>, <em>clean_speaker_names=True</em>, <em>interpret_html_escapes=True</em>, <em>indexed_traces=True</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.get_word" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.get_word_string">
<tt class="descname">get_word_string</tt><big>(</big><em>buckwalter=False</em>, <em>vocalized=True</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.get_word_string" title="Permalink to this definition">¶</a></dt>
<dd><p>return the words for this tree, separated by spaces.</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.get_trace_adjusted_word_string">
<tt class="descname">get_trace_adjusted_word_string</tt><big>(</big><em>buckwalter=False</em>, <em>vocalized=True</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.get_trace_adjusted_word_string" title="Permalink to this definition">¶</a></dt>
<dd><p>The same as <a class="reference internal" href="#on.corpora.tree.tree.get_word_string" title="on.corpora.tree.tree.get_word_string"><tt class="xref py py-meth docutils literal"><span class="pre">get_word_string()</span></tt></a> but without including traces</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.get_plain_sentence">
<tt class="descname">get_plain_sentence</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.get_plain_sentence" title="Permalink to this definition">¶</a></dt>
<dd><p>display this sentence with as close to normal typographical conventions as we can.</p>
<p>Note that the return value of this function <em>does not</em> follow ontonotes tokenization.</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.pointer">
<tt class="descname">pointer</tt><big>(</big><em>indexing='token'</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.pointer" title="Permalink to this definition">¶</a></dt>
<dd><p>(document_id, tree_index, sentence_index)</p>
<p>Return a triple in the format of the pointers in a sense or prop file.</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.fix_trace_index_locations">
<tt class="descname">fix_trace_index_locations</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.fix_trace_index_locations" title="Permalink to this definition">¶</a></dt>
<dd><p>Reconcile the two forms of trace index notation; set up syntactic link pointers</p>
<p>All trees distributed with ontonotes have been through this process.</p>
<p>There are two forms used in the annotation, one by ann taylor,
the other by the ldc.</p>
<p>terminology note: we&#8217;re using &#8216;word&#8217; and &#8216;tag&#8217; as in (tag word) and (tag (tag word))</p>
<p>In the original Penn Treebank system, a trace is a link
between exactly two tree nodes, with the target index on the
tag of the parent and the reference index on the word of the
trace.  If there are more than one node in a trace, they&#8217;re
chained, with something like:</p>
<div class="highlight-scheme"><div class="highlight"><pre><span class="p">(</span><span class="nf">NP-1</span> <span class="p">(</span><span class="nf">NP</span> <span class="nv">target</span><span class="p">))</span> <span class="o">...</span>
   <span class="p">(</span><span class="nf">NP-2</span> <span class="p">(</span><span class="nf">-NONE-</span> <span class="nv">*-1</span><span class="p">))</span> <span class="o">...</span>
     <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">-NONE-</span> <span class="nv">*-2</span><span class="p">))</span> <span class="o">...</span>
</pre></div>
</div>
<p>In the LDC system a trace index can apply to arbitrarily many
nodes and all indecies are on the tag of the parent.  So this
same situation would be notated as:</p>
<div class="highlight-scheme"><div class="highlight"><pre><span class="p">(</span><span class="nf">NP-1</span> <span class="p">(</span><span class="nf">NP</span> <span class="nv">target</span><span class="p">))</span> <span class="o">...</span>
  <span class="p">(</span><span class="nf">NP-1</span> <span class="p">(</span><span class="nf">-NONE-</span> <span class="nv">*</span><span class="p">))</span> <span class="o">...</span>
    <span class="p">(</span><span class="nf">NP-1</span> <span class="p">(</span><span class="nf">-NONE-</span> <span class="nv">*</span><span class="p">))</span> <span class="o">...</span>
</pre></div>
</div>
<p>We&#8217;re leaving everything in the original Penn Treebank format
alone, but changing the ldc format to a hybrid mode where
there can be multiple nodes in a trace chain, but the
reference indecies are on the words:</p>
<div class="highlight-scheme"><div class="highlight"><pre><span class="p">(</span><span class="nf">NP-1</span> <span class="p">(</span><span class="nf">NP</span> <span class="nv">target</span><span class="p">))</span> <span class="o">...</span>
  <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">-NONE-</span> <span class="nv">*-1</span><span class="p">))</span> <span class="o">...</span>
    <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">-NONE-</span> <span class="nv">*-1</span><span class="p">))</span> <span class="o">...</span>
</pre></div>
</div>
<p>There are a few tricky details:</p>
<blockquote>
<div><ul>
<li><p class="first">We have to be able to tell by looking at a tree which format it&#8217;s in</p>
<blockquote>
<div><ul class="simple">
<li>if there are ever words with trace indicies, this mean&#8217;s we&#8217;re using the original Penn Treebank format</li>
</ul>
</div></blockquote>
</li>
<li><p class="first">We might not be able to tell what the target is</p>
<blockquote>
<div><ul class="simple">
<li>The ideal case has one or more -NONE- tags on traces and exactly one without -NONE-</li>
<li>If there are more than one without -NONE- then we need to pick one to be the target.  Choose the leftmost</li>
<li>If there is none without -NONE- then we also need to pick one to be the target.  Again choose the leftmost.</li>
</ul>
</div></blockquote>
</li>
</ul>
</div></blockquote>
<p>We also need to deal with gapping.  This is for sentences like:</p>
<blockquote>
<div>&#8216;Mary likes Bach and Susan, Bethoven&#8217;</div></blockquote>
<p>These are notated as:</p>
<div class="highlight-scheme"><div class="highlight"><pre><span class="p">(</span><span class="nf">S</span> <span class="p">(</span><span class="nf">S</span> <span class="p">(</span><span class="nf">NP-SBJ=1</span> <span class="nv">Mary</span><span class="p">)</span>
      <span class="p">(</span><span class="nf">VP</span> <span class="nv">likes</span>
         <span class="p">(</span><span class="nf">NP=2</span> <span class="nv">Bach</span><span class="p">)))</span>
    <span class="nv">and</span>
   <span class="p">(</span><span class="nf">S</span> <span class="p">(</span><span class="nf">NP-SBJ=1</span> <span class="nv">Susan</span><span class="p">)</span>
       <span class="o">,</span>
       <span class="p">(</span><span class="nf">NP=2</span> <span class="nv">Beethoven</span><span class="p">)))</span>
</pre></div>
</div>
<p>in the LDC version, and as:</p>
<div class="highlight-scheme"><div class="highlight"><pre><span class="p">(</span><span class="nf">S</span> <span class="p">(</span><span class="nf">S</span> <span class="p">(</span><span class="nf">NP-SBJ-1</span> <span class="nv">Mary</span><span class="p">)</span>
      <span class="p">(</span><span class="nf">VP</span> <span class="nv">likes</span>
         <span class="p">(</span><span class="nf">NP-2</span> <span class="nv">Bach</span><span class="p">)))</span>
    <span class="nv">and</span>
   <span class="p">(</span><span class="nf">S</span> <span class="p">(</span><span class="nf">NP-SBJ=1</span> <span class="nv">Susan</span><span class="p">)</span>
       <span class="o">,</span>
       <span class="p">(</span><span class="nf">NP=2</span> <span class="nv">Beethoven</span><span class="p">)))</span>
</pre></div>
</div>
<p>in the original Penn Treebank version.</p>
<p>We convert them all to the original Penn Treebank version, with the target having
a single hyphen and references having the double hyphens.</p>
<p>There can also be trees with both gapping and normal traces, as in:</p>
<div class="highlight-scheme"><div class="highlight"><pre><span class="p">(</span><span class="nf">NP</span> <span class="nv">fears</span>
  <span class="p">(</span><span class="nf">SBAR</span> <span class="nv">that</span>
    <span class="p">(</span><span class="nf">S</span> <span class="p">(</span><span class="nf">S</span> <span class="p">(</span><span class="nf">NP-SBJ=2</span> <span class="nv">the</span> <span class="nv">Thatcher</span> <span class="nv">government</span><span class="p">)</span>
          <span class="p">(</span><span class="nf">VP</span> <span class="nv">may</span> <span class="p">(</span><span class="nf">VP</span> <span class="nv">be</span> <span class="p">(</span><span class="nf">PP-PRD=3</span> <span class="nv">in</span> <span class="p">(</span><span class="nf">NP</span> <span class="nv">turmoil</span><span class="p">)))))</span>
        <span class="nv">and</span>
       <span class="p">(</span><span class="nf">S</span> <span class="p">(</span><span class="nf">NP-SBJ-1=2</span> <span class="p">(</span><span class="nf">NP</span> <span class="nv">Britain</span> <span class="ss">&#39;s</span><span class="p">)</span> <span class="nv">Labor</span> <span class="nv">Party</span><span class="p">)</span>
          <span class="p">(</span><span class="nf">VP=3</span> <span class="nv">positioned</span>
            <span class="p">(</span><span class="nf">S</span> <span class="p">(</span><span class="nf">NP-SBJ-1</span> <span class="nv">*</span><span class="p">)</span>
               <span class="p">(</span><span class="nf">VP</span> <span class="nv">to</span> <span class="p">(</span><span class="nf">VP</span> <span class="nv">regain</span> <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NP</span> <span class="nv">control</span><span class="p">)</span>
                                 <span class="p">(</span><span class="nf">PP</span> <span class="nv">of</span> <span class="p">(</span><span class="nf">NP</span> <span class="nv">the</span> <span class="nv">government</span><span class="p">)))))))))))</span>
</pre></div>
</div>
<p>So we need to deal with things like &#8216;<tt class="docutils literal"><span class="pre">NP-SBJ-1=2</span></tt>&#8216; properly.</p>
<p>Also set up leaf.reference_leaves and leaf.identity_subtree</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.get_sentence_index">
<tt class="descname">get_sentence_index</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.get_sentence_index" title="Permalink to this definition">¶</a></dt>
<dd><p>the index of the sentence (zero-indexed) that this tree represents</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.get_word_index">
<tt class="descname">get_word_index</tt><big>(</big><em>sloppy=False</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.get_word_index" title="Permalink to this definition">¶</a></dt>
<dd><p>the index of the word in the sentence not counting traces</p>
<dl class="docutils">
<dt>sloppy is one of:</dt>
<dd>False: be strict
&#8216;next&#8217; : if self is a trace, take the next non-trace leaf
&#8216;prev&#8217; : if self is a trace, take the prev non-trace leaf</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.get_token_index">
<tt class="descname">get_token_index</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.get_token_index" title="Permalink to this definition">¶</a></dt>
<dd><p>the index of the word in the sentence including traces</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.get_height">
<tt class="descname">get_height</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.get_height" title="Permalink to this definition">¶</a></dt>
<dd><p>how many times removed this node is from its initial leaf.</p>
<p>Examples:</p>
<blockquote>
<div><ul class="simple">
<li>height of <tt class="docutils literal"><span class="pre">(NNS</span> <span class="pre">cabbages)</span></tt> is 0</li>
<li>height of <tt class="docutils literal"><span class="pre">(NP</span> <span class="pre">(NNS</span> <span class="pre">cabbages))</span></tt> is 1</li>
<li>height of <tt class="docutils literal"><span class="pre">(PP</span> <span class="pre">(IN</span> <span class="pre">of)</span> <span class="pre">(NP</span> <span class="pre">(NNS</span> <span class="pre">cabbages)))</span></tt> is also 1 because <tt class="docutils literal"><span class="pre">(IN</span> <span class="pre">of)</span></tt> is its initial leaf</li>
</ul>
</div></blockquote>
<p>Used by propositions</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.leaves">
<tt class="descname">leaves</tt><big>(</big><em>regen_cache=False</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.leaves" title="Permalink to this definition">¶</a></dt>
<dd><p>generate the leaves under this subtree</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.subtrees">
<tt class="descname">subtrees</tt><big>(</big><em>regen_cache=False</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.subtrees" title="Permalink to this definition">¶</a></dt>
<dd><p>generate the subtrees under this subtree, including this one</p>
<p>order is always top to bottom; if A contains B then index(A) &lt; index(B)</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.__getitem__">
<tt class="descname">__getitem__</tt><big>(</big><em>x</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.__getitem__" title="Permalink to this definition">¶</a></dt>
<dd><p>get a leaf, list of leaves, or subtree of this tree</p>
<p>The semantics of this when used with a slice are tricky.  For
many purposes you would do better to use one of the following
instead:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.tree.tree.leaves" title="on.corpora.tree.tree.leaves"><tt class="xref py py-meth docutils literal"><span class="pre">tree.leaves()</span></tt></a> &#8211; if you want a list of leaves</li>
<li><a class="reference internal" href="#on.corpora.tree.tree.subtrees" title="on.corpora.tree.tree.subtrees"><tt class="xref py py-meth docutils literal"><span class="pre">tree.subtrees()</span></tt></a> &#8211; if you want a list of subtrees</li>
<li><a class="reference internal" href="#on.corpora.tree.tree.get_subtree_by_span" title="on.corpora.tree.tree.get_subtree_by_span"><tt class="xref py py-meth docutils literal"><span class="pre">tree.get_subtree_by_span()</span></tt></a> &#8211; if you want a subtree
matching <tt class="docutils literal"><span class="pre">start</span></tt> and <tt class="docutils literal"><span class="pre">end</span></tt> leaves or indexes.</li>
</ul>
</div></blockquote>
<p>This function is nice, though, especially for interactive use.
The logic is:</p>
<blockquote>
<div><ul class="simple">
<li>if the argument is a single index, return that leaf, or
index error if it does not exist</li>
<li>otherwise think of the tree as a list of leaves.  The
argument is then interpreted just as list.__getitem__ does,
with full slice support.</li>
<li>if such interpretation leads to a list of leaves that is a
proper subtree of this one, return that subtree<ul>
<li>note that if a subtree has a single child, two such
subtrees can match.  If more than one matches, we take
the <em>highest</em> one.</li>
</ul>
</li>
<li>if all the slice can be interpreted to represent is an
arbitrary list of leaves, return that list.</li>
</ul>
</div></blockquote>
<p>For example, consider the following tree:</p>
<div class="highlight-scheme"><div class="highlight"><pre><span class="p">(</span><span class="nf">TOP</span> <span class="p">(</span><span class="nf">S</span> <span class="p">(</span><span class="nf">PP-MNR</span> <span class="p">(</span><span class="nf">IN</span> <span class="nv">Like</span><span class="p">)</span>
        <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">JJ</span> <span class="nv">many</span><span class="p">)</span>
            <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Heartland</span><span class="p">)</span>
            <span class="p">(</span><span class="nf">NNS</span> <span class="nv">states</span><span class="p">)))</span>
        <span class="p">(</span><span class="o">,</span> <span class="o">,</span><span class="p">)</span>
        <span class="p">(</span><span class="nf">NP-SBJ</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Iowa</span><span class="p">))</span>
        <span class="p">(</span><span class="nf">VP</span> <span class="p">(</span><span class="nf">VBZ</span> <span class="nv">has</span><span class="p">)</span>
            <span class="p">(</span><span class="nf">VP</span> <span class="p">(</span><span class="nf">VBN</span> <span class="nv">had</span><span class="p">)</span>
                <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NN</span> <span class="nv">trouble</span><span class="p">))</span>
                    <span class="p">(</span><span class="nf">S-NOM</span> <span class="p">(</span><span class="nf">NP-SBJ</span> <span class="p">(</span><span class="nf">-NONE-</span> <span class="nv">*PRO*</span><span class="p">))</span>
                           <span class="p">(</span><span class="nf">VP</span> <span class="p">(</span><span class="nf">VBG</span> <span class="nv">keeping</span><span class="p">)</span>
                               <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">JJ</span> <span class="nv">young</span><span class="p">)</span>
                                   <span class="p">(</span><span class="nf">NNS</span> <span class="nv">people</span><span class="p">))</span>
                               <span class="p">(</span><span class="nf">ADVP-LOC</span> <span class="p">(</span><span class="nf">ADVP</span> <span class="p">(</span><span class="nf">RB</span> <span class="nv">down</span><span class="p">)</span>
                                               <span class="p">(</span><span class="nf">PP</span> <span class="p">(</span><span class="nf">IN</span> <span class="nv">on</span><span class="p">)</span>
                                                   <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">DT</span> <span class="nv">the</span><span class="p">)</span>
                                                       <span class="p">(</span><span class="nf">NN</span> <span class="nv">farm</span><span class="p">))))</span>
                                         <span class="p">(</span><span class="nf">CC</span> <span class="nv">or</span><span class="p">)</span>
                                         <span class="p">(</span><span class="nf">ADVP</span> <span class="p">(</span><span class="nf">RB</span> <span class="nv">anywhere</span><span class="p">)</span>
                                               <span class="p">(</span><span class="nf">PP</span> <span class="p">(</span><span class="nf">IN</span> <span class="nv">within</span><span class="p">)</span>
                                                   <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NN</span> <span class="nv">state</span><span class="p">)</span>
                                                       <span class="p">(</span><span class="nf">NNS</span> <span class="nv">lines</span><span class="p">))))))))))</span>
        <span class="p">(</span><span class="o">.</span> <span class="o">.</span><span class="p">)))</span>
</pre></div>
</div>
<p>The simplest thing we can do is look at individual leaves, such as <tt class="docutils literal"><span class="pre">tree[2]</span></tt>:</p>
<div class="highlight-scheme"><div class="highlight"><pre><span class="p">(</span><span class="nf">NNP</span> <span class="nv">Heartland</span><span class="p">)</span>
</pre></div>
</div>
<p>Note that leaves act as subtrees, so even if we index a leaf,
<tt class="docutils literal"><span class="pre">tree[2][0]</span></tt> we get it back again:</p>
<div class="highlight-scheme"><div class="highlight"><pre><span class="p">(</span><span class="nf">NNP</span> <span class="nv">Heartland</span><span class="p">)</span>
</pre></div>
</div>
<p>If we look at a valid subtree, like with <tt class="docutils literal"><span class="pre">tree[0:4]</span></tt>, we see:</p>
<div class="highlight-scheme"><div class="highlight"><pre><span class="p">(</span><span class="nf">PP-MNR</span> <span class="p">(</span><span class="nf">IN</span> <span class="nv">Like</span><span class="p">)</span>
        <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">JJ</span> <span class="nv">many</span><span class="p">)</span>
            <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Heartland</span><span class="p">)</span>
            <span class="p">(</span><span class="nf">NNS</span> <span class="nv">states</span><span class="p">)))</span>
</pre></div>
</div>
<p>If our indexes do not fall exactly on subtree bounds, we instead get a list of leaves:</p>
<div class="highlight-scheme"><pre>[(IN Like),
 (JJ many),
 (NNP Heartland),
 (NNS states),
 (, ,)]</pre>
</div>
<p>Extended slices are supported, though they&#8217;re probably not
very useful.  For example, we can make a list of the even
leaves of the tree in reverse order with <tt class="docutils literal"><span class="pre">tree[::-2]</span></tt>:</p>
<div class="highlight-scheme"><pre>[(. .),
 (NN state),
 (RB anywhere),
 (NN farm),
 (IN on),
 (NNS people),
 (VBG keeping),
 (NN trouble),
 (VBZ has),
 (, ,),
 (NNP Heartland),
 (IN Like)]</pre>
</div>
</dd></dl>

<dl class="method">
<dt id="on.corpora.tree.tree.get_other_leaf">
<tt class="descname">get_other_leaf</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#on.corpora.tree.tree.get_other_leaf" title="Permalink to this definition">¶</a></dt>
<dd><p>Get leaves relative to this one.  An index of zero is this
leaf, negative one would be the previous leaf, etc.  If the
leaf does not exist, we return None</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="on.corpora.tree.lemma">
<em class="property">class </em><tt class="descclassname">on.corpora.tree.</tt><tt class="descname">lemma</tt><big>(</big><em>input_string</em>, <em>b_transliteration</em>, <em>comment</em>, <em>index</em>, <em>offset</em>, <em>unvocalized_string</em>, <em>vocalized_string</em>, <em>vocalized_input</em>, <em>pos</em>, <em>gloss</em>, <em>lemma</em>, <em>coarse_sense</em>, <em>leaf_id</em><big>)</big><a class="headerlink" href="#on.corpora.tree.lemma" title="Permalink to this definition">¶</a></dt>
<dd><p>arabic trees have extra lemma information</p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.tree.syntactic_link">
<em class="property">class </em><tt class="descclassname">on.corpora.tree.</tt><tt class="descname">syntactic_link</tt><big>(</big><em>type</em>, <em>word</em>, <em>reference_subtree_id</em>, <em>identity_subtree_id</em><big>)</big><a class="headerlink" href="#on.corpora.tree.syntactic_link" title="Permalink to this definition">¶</a></dt>
<dd><p>Links between tree nodes</p>
<p>Example:</p>
<blockquote>
<div><div class="highlight-scheme"><div class="highlight"><pre><span class="p">(</span><span class="nf">TOP</span> <span class="p">(</span><span class="nf">SBARQ</span> <span class="p">(</span><span class="nf">WHNP-1</span> <span class="p">(</span><span class="nf">WHADJP</span> <span class="p">(</span><span class="nf">WRB</span> <span class="nv">How</span><span class="p">)</span>
                            <span class="p">(</span><span class="nf">JJ</span> <span class="nv">many</span><span class="p">))</span>
                    <span class="p">(</span><span class="nf">NNS</span> <span class="nv">ups</span><span class="p">)</span>
                    <span class="p">(</span><span class="nf">CC</span> <span class="nv">and</span><span class="p">)</span>
                    <span class="p">(</span><span class="nf">NNS</span> <span class="nv">downs</span><span class="p">))</span>
            <span class="p">(</span><span class="nf">SQ</span> <span class="p">(</span><span class="nf">MD</span> <span class="nv">can</span><span class="p">)</span>
                <span class="p">(</span><span class="nf">NP-SBJ</span> <span class="p">(</span><span class="nf">CD</span> <span class="nv">one</span><span class="p">)</span>
                        <span class="p">(</span><span class="nf">NN</span> <span class="nv">woman</span><span class="p">))</span>
                <span class="p">(</span><span class="nf">VP</span> <span class="p">(</span><span class="nf">VB</span> <span class="nv">have</span><span class="p">)</span>
                    <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">-NONE-</span> <span class="nv">*T*-1</span><span class="p">))))</span>
            <span class="p">(</span><span class="o">.</span> <span class="nv">/?</span><span class="p">)))</span>
</pre></div>
</div>
<p>The node <tt class="docutils literal"><span class="pre">(-NONE-</span> <span class="pre">*T*-1)</span></tt> is a syntactic link back to <tt class="docutils literal"><span class="pre">(WHNP-1</span> <span class="pre">(WHADJP</span> <span class="pre">(WRB</span> <span class="pre">How)</span> <span class="pre">(JJ</span> <span class="pre">many))</span> <span class="pre">(NNS</span> <span class="pre">ups)</span> <span class="pre">(CC</span> <span class="pre">and)</span> <span class="pre">(NNS</span> <span class="pre">downs))</span></tt>.</p>
</div></blockquote>
<p>Links have an identity subtree <tt class="docutils literal"><span class="pre">(How</span> <span class="pre">many</span> <span class="pre">ups</span> <span class="pre">and</span> <span class="pre">downs)</span></tt> and a
reference subtree <tt class="docutils literal"><span class="pre">(-NONE-</span> <span class="pre">*T*-1)</span></tt> and are generally thought of
as a link from the reference back to the identity.</p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.tree.compound_function_tag">
<em class="property">class </em><tt class="descclassname">on.corpora.tree.</tt><tt class="descname">compound_function_tag</tt><big>(</big><em>a_function_tag_string</em>, <em>subtree</em><big>)</big><a class="headerlink" href="#on.corpora.tree.compound_function_tag" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="exception">
<dt id="on.corpora.tree.tree_exception">
<em class="property">exception </em><tt class="descclassname">on.corpora.tree.</tt><tt class="descname">tree_exception</tt><a class="headerlink" href="#on.corpora.tree.tree_exception" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<span class="target" id="module-on.corpora.proposition"></span><div class="section" id="proposition-proposition-annotation">
<h2><tt class="xref py py-mod docutils literal"><span class="pre">proposition</span></tt> &#8211; Proposition Annotation<a class="headerlink" href="#proposition-proposition-annotation" title="Permalink to this headline">¶</a></h2>
<p>See:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.proposition.proposition" title="on.corpora.proposition.proposition"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.proposition.proposition</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.proposition_bank" title="on.corpora.proposition.proposition_bank"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.proposition.proposition_bank</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.frame_set" title="on.corpora.proposition.frame_set"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.proposition.frame_set</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.sense.pb_sense_type" title="on.corpora.sense.pb_sense_type"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.sense.pb_sense_type</span></tt></a></li>
</ul>
</div></blockquote>
<p>Correspondences:</p>
<blockquote>
<div><table border="1" class="docutils">
<colgroup>
<col width="18%" />
<col width="23%" />
<col width="58%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head"><strong>Database Tables</strong></th>
<th class="head"><strong>Python Objects</strong></th>
<th class="head"><strong>File Elements</strong></th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">proposition_bank</span></tt></td>
<td><a class="reference internal" href="#on.corpora.proposition.proposition_bank" title="on.corpora.proposition.proposition_bank"><tt class="xref py py-class docutils literal"><span class="pre">proposition_bank</span></tt></a></td>
<td>All <tt class="docutils literal"><span class="pre">.prop</span></tt> files in an <a class="reference internal" href="#on.corpora.subcorpus" title="on.corpora.subcorpus"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.subcorpus</span></tt></a></td>
</tr>
<tr class="row-odd"><td>None</td>
<td><a class="reference internal" href="#on.corpora.proposition.proposition_document" title="on.corpora.proposition.proposition_document"><tt class="xref py py-class docutils literal"><span class="pre">proposition_document</span></tt></a></td>
<td>A single <tt class="docutils literal"><span class="pre">.prop</span></tt> file</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">proposition</span></tt></td>
<td><a class="reference internal" href="#on.corpora.proposition.proposition" title="on.corpora.proposition.proposition"><tt class="xref py py-class docutils literal"><span class="pre">proposition</span></tt></a></td>
<td>A line in a <tt class="docutils literal"><span class="pre">.prop</span></tt> file, with everything after the <tt class="docutils literal"><span class="pre">-----</span></tt> an &#8220;argument field&#8221;</td>
</tr>
<tr class="row-odd"><td>None</td>
<td><a class="reference internal" href="#on.corpora.proposition.predicate_analogue" title="on.corpora.proposition.predicate_analogue"><tt class="xref py py-class docutils literal"><span class="pre">predicate_analogue</span></tt></a></td>
<td>REL argument fields (should only be one)</td>
</tr>
<tr class="row-even"><td>None</td>
<td><a class="reference internal" href="#on.corpora.proposition.argument_analogue" title="on.corpora.proposition.argument_analogue"><tt class="xref py py-class docutils literal"><span class="pre">argument_analogue</span></tt></a></td>
<td>ARG argument fields</td>
</tr>
<tr class="row-odd"><td>None</td>
<td><a class="reference internal" href="#on.corpora.proposition.link_analogue" title="on.corpora.proposition.link_analogue"><tt class="xref py py-class docutils literal"><span class="pre">link_analogue</span></tt></a></td>
<td>LINK argument fields</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">predicate</span></tt></td>
<td><a class="reference internal" href="#on.corpora.proposition.predicate" title="on.corpora.proposition.predicate"><tt class="xref py py-class docutils literal"><span class="pre">predicate</span></tt></a></td>
<td>Asterisk-separated components of a predicate_analogue.  Each part is coreferential.</td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">argument</span></tt></td>
<td><a class="reference internal" href="#on.corpora.proposition.argument" title="on.corpora.proposition.argument"><tt class="xref py py-class docutils literal"><span class="pre">argument</span></tt></a></td>
<td>Asterisk-separated components of an argument_analogue.  Each part is coreferential.</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">proposition_link</span></tt></td>
<td><a class="reference internal" href="#on.corpora.proposition.link" title="on.corpora.proposition.link"><tt class="xref py py-class docutils literal"><span class="pre">link</span></tt></a></td>
<td>Asterisk-separated components of a link_analogue. Each part is coreferential.</td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">predicate_node</span></tt></td>
<td><a class="reference internal" href="#on.corpora.proposition.predicate_node" title="on.corpora.proposition.predicate_node"><tt class="xref py py-class docutils literal"><span class="pre">predicate_node</span></tt></a></td>
<td>Comma-separated components of predicates.  The parts together make up the predicate.</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">argument_node</span></tt></td>
<td><a class="reference internal" href="#on.corpora.proposition.argument_node" title="on.corpora.proposition.argument_node"><tt class="xref py py-class docutils literal"><span class="pre">argument_node</span></tt></a></td>
<td>Comma-separated components of arguments.  The parts together make up the argument.</td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">link_node</span></tt></td>
<td><a class="reference internal" href="#on.corpora.proposition.link_node" title="on.corpora.proposition.link_node"><tt class="xref py py-class docutils literal"><span class="pre">link_node</span></tt></a></td>
<td>Comma-separated components of links.  The parts together make up the link.</td>
</tr>
<tr class="row-even"><td>None</td>
<td><a class="reference internal" href="#on.corpora.proposition.frame_set" title="on.corpora.proposition.frame_set"><tt class="xref py py-class docutils literal"><span class="pre">frame_set</span></tt></a></td>
<td>An xml frame file (FF)</td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">pb_sense_type</span></tt></td>
<td><a class="reference internal" href="#on.corpora.sense.pb_sense_type" title="on.corpora.sense.pb_sense_type"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.sense.pb_sense_type</span></tt></a></td>
<td>Field six of a prop line and a FF&#8217;s <tt class="docutils literal"><span class="pre">frameset/predicate/roleset</span></tt> element&#8217;s <tt class="docutils literal"><span class="pre">id</span></tt> attribute</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">pb_sense_type_argument_type</span></tt></td>
<td><tt class="xref py py-class docutils literal"><span class="pre">argument_composition</span></tt></td>
<td>For a FF&#8217;s <tt class="docutils literal"><span class="pre">frameset/predicate</span></tt> element, a mapping between <tt class="docutils literal"><span class="pre">roleset.id</span></tt> and <tt class="docutils literal"><span class="pre">roleset/role.n</span></tt></td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">tree</span></tt></td>
<td><a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a></td>
<td>The first three fields of a prop line</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>This may be better seen with an example.  The prop line:</p>
<blockquote>
<div><tt class="docutils literal"><span class="pre">bc/cnn/00/cnn_0000&#64;all&#64;cnn&#64;bc&#64;en&#64;on</span> <span class="pre">191</span> <span class="pre">3</span> <span class="pre">gold</span> <span class="pre">say-v</span> <span class="pre">say.01</span> <span class="pre">-----</span> <span class="pre">1:1-ARGM-DIS</span> <span class="pre">2:1-ARG0</span> <span class="pre">3:0-rel</span> <span class="pre">4:1*6:1,8:1-ARG1</span></tt></div></blockquote>
<p>breaks up as:</p>
<blockquote>
<div><table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head"><strong>Python Object</strong></th>
<th class="head"><strong>File Text</strong></th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="#on.corpora.proposition.proposition" title="on.corpora.proposition.proposition"><tt class="xref py py-class docutils literal"><span class="pre">proposition</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">bc/cnn/00/cnn_0000&#64;all&#64;cnn&#64;bc&#64;en&#64;on</span> <span class="pre">191</span> <span class="pre">3</span> <span class="pre">gold</span> <span class="pre">say-v</span> <span class="pre">say.01</span> <span class="pre">-----</span> <span class="pre">1:1-ARGM-DIS</span> <span class="pre">2:1-ARG0</span> <span class="pre">3:0-rel</span> <span class="pre">4:1*6:1,8:1-ARG1</span></tt></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">bc/cnn/00/cnn_0000&#64;all&#64;cnn&#64;bc&#64;en&#64;on</span> <span class="pre">191</span> <span class="pre">3</span></tt></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#on.corpora.proposition.predicate_analogue" title="on.corpora.proposition.predicate_analogue"><tt class="xref py py-class docutils literal"><span class="pre">predicate_analogue</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">3:0-rel</span></tt></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#on.corpora.proposition.predicate" title="on.corpora.proposition.predicate"><tt class="xref py py-class docutils literal"><span class="pre">predicate</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">3:0</span></tt></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#on.corpora.proposition.predicate_node" title="on.corpora.proposition.predicate_node"><tt class="xref py py-class docutils literal"><span class="pre">predicate_node</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">3:0</span></tt></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#on.corpora.proposition.argument_analogue" title="on.corpora.proposition.argument_analogue"><tt class="xref py py-class docutils literal"><span class="pre">argument_analogue</span></tt></a></td>
<td>each of <tt class="docutils literal"><span class="pre">1:1-ARGM-DIS</span></tt>, <tt class="docutils literal"><span class="pre">2:1-ARG0</span></tt>, and <tt class="docutils literal"><span class="pre">4:1*6:1,8:1-ARG1</span></tt></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#on.corpora.proposition.argument" title="on.corpora.proposition.argument"><tt class="xref py py-class docutils literal"><span class="pre">argument</span></tt></a></td>
<td>each of <tt class="docutils literal"><span class="pre">1:1</span></tt>, <tt class="docutils literal"><span class="pre">2:1</span></tt>, <tt class="docutils literal"><span class="pre">4:1</span></tt>, and <tt class="docutils literal"><span class="pre">6:1,8:1</span></tt></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#on.corpora.proposition.argument_node" title="on.corpora.proposition.argument_node"><tt class="xref py py-class docutils literal"><span class="pre">argument_node</span></tt></a></td>
<td>each of <tt class="docutils literal"><span class="pre">1:1</span></tt>, <tt class="docutils literal"><span class="pre">2:1</span></tt>, <tt class="docutils literal"><span class="pre">4:1</span></tt>, <tt class="docutils literal"><span class="pre">6:1</span></tt>, and <tt class="docutils literal"><span class="pre">8:1</span></tt></td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>Similarly, the prop line:</p>
<blockquote>
<div><tt class="docutils literal"><span class="pre">bc/cnn/00/cnn_0000&#64;all&#64;cnn&#64;bc&#64;en&#64;on</span> <span class="pre">309</span> <span class="pre">5</span> <span class="pre">gold</span> <span class="pre">go-v</span> <span class="pre">go.15</span> <span class="pre">-----</span> <span class="pre">2:0*1:1-ARG1</span> <span class="pre">4:1-ARGM-ADV</span> <span class="pre">5:0,6:1-rel</span></tt></div></blockquote>
<p>breaks up as:</p>
<blockquote>
<div><table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head"><strong>Python Object</strong></th>
<th class="head"><strong>File Text</strong></th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="#on.corpora.proposition.proposition" title="on.corpora.proposition.proposition"><tt class="xref py py-class docutils literal"><span class="pre">proposition</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">bc/cnn/00/cnn_0000&#64;all&#64;cnn&#64;bc&#64;en&#64;on</span> <span class="pre">309</span> <span class="pre">5</span> <span class="pre">gold</span> <span class="pre">go-v</span> <span class="pre">go.15</span> <span class="pre">-----</span> <span class="pre">2:0*1:1-ARG1</span> <span class="pre">4:1-ARGM-ADV</span> <span class="pre">5:0,6:1-rel</span></tt></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">bc/cnn/00/cnn_0000&#64;all&#64;cnn&#64;bc&#64;en&#64;on</span> <span class="pre">309</span> <span class="pre">5</span></tt></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#on.corpora.proposition.predicate_analogue" title="on.corpora.proposition.predicate_analogue"><tt class="xref py py-class docutils literal"><span class="pre">predicate_analogue</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">5:0,6:1-rel</span></tt></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#on.corpora.proposition.predicate" title="on.corpora.proposition.predicate"><tt class="xref py py-class docutils literal"><span class="pre">predicate</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">5:0,6:1</span></tt></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#on.corpora.proposition.predicate_node" title="on.corpora.proposition.predicate_node"><tt class="xref py py-class docutils literal"><span class="pre">predicate_node</span></tt></a></td>
<td>each of <tt class="docutils literal"><span class="pre">5:0</span></tt> and <tt class="docutils literal"><span class="pre">6:1</span></tt></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#on.corpora.proposition.argument_analogue" title="on.corpora.proposition.argument_analogue"><tt class="xref py py-class docutils literal"><span class="pre">argument_analogue</span></tt></a></td>
<td>each of <tt class="docutils literal"><span class="pre">2:0*1:1-ARG1</span></tt> and <tt class="docutils literal"><span class="pre">4:1-ARGM-ADV</span></tt></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#on.corpora.proposition.argument" title="on.corpora.proposition.argument"><tt class="xref py py-class docutils literal"><span class="pre">argument</span></tt></a></td>
<td>each of <tt class="docutils literal"><span class="pre">2:0</span></tt>, <tt class="docutils literal"><span class="pre">1:1</span></tt> and <tt class="docutils literal"><span class="pre">4:1</span></tt></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#on.corpora.proposition.argument_node" title="on.corpora.proposition.argument_node"><tt class="xref py py-class docutils literal"><span class="pre">argument_node</span></tt></a></td>
<td>each of <tt class="docutils literal"><span class="pre">2:0</span></tt>, <tt class="docutils literal"><span class="pre">1:1</span></tt>, and <tt class="docutils literal"><span class="pre">4:1</span></tt></td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>Classes:</p>
<dl class="class">
<dt id="on.corpora.proposition.proposition_bank">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">proposition_bank</tt><big>(</big><em>a_subcorpus</em>, <em>tag</em>, <em>a_cursor=None</em>, <em>extension='prop'</em>, <em>a_frame_set_hash=None</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.proposition_bank" title="Permalink to this definition">¶</a></dt>
<dd><p>Extends: <a class="reference internal" href="#on.corpora.abstract_bank" title="on.corpora.abstract_bank"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.abstract_bank</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.proposition.proposition_document" title="on.corpora.proposition.proposition_document"><tt class="xref py py-class docutils literal"><span class="pre">proposition_document</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.proposition_document">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">proposition_document</tt><big>(</big><em>document_id</em>, <em>extension='prop'</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.proposition_document" title="Permalink to this definition">¶</a></dt>
<dd><p>Contained by: <a class="reference internal" href="#on.corpora.proposition.proposition_bank" title="on.corpora.proposition.proposition_bank"><tt class="xref py py-class docutils literal"><span class="pre">proposition_bank</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.proposition.proposition" title="on.corpora.proposition.proposition"><tt class="xref py py-class docutils literal"><span class="pre">proposition</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.proposition">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">proposition</tt><big>(</big><em>encoded_prop</em>, <em>subcorpus_id</em>, <em>document_id</em>, <em>a_proposition_bank=None</em>, <em>tag=None</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.proposition" title="Permalink to this definition">¶</a></dt>
<dd><p>a proposition annotation; a line in a .prop file</p>
<p>Contained by: <a class="reference internal" href="#on.corpora.proposition.proposition_document" title="on.corpora.proposition.proposition_document"><tt class="xref py py-class docutils literal"><span class="pre">proposition_document</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.proposition.predicate_analogue" title="on.corpora.proposition.predicate_analogue"><tt class="xref py py-class docutils literal"><span class="pre">predicate_analogue</span></tt></a> , <a class="reference internal" href="#on.corpora.proposition.argument_analogue" title="on.corpora.proposition.argument_analogue"><tt class="xref py py-class docutils literal"><span class="pre">argument_analogue</span></tt></a> , and <a class="reference internal" href="#on.corpora.proposition.link_analogue" title="on.corpora.proposition.link_analogue"><tt class="xref py py-class docutils literal"><span class="pre">link_analogue</span></tt></a> (in that order)</p>
<p>Attributes:</p>
<blockquote>
<div><dl class="attribute">
<dt id="on.corpora.proposition.proposition.lemma">
<tt class="descname">lemma</tt><a class="headerlink" href="#on.corpora.proposition.proposition.lemma" title="Permalink to this definition">¶</a></dt>
<dd><p>Which <a class="reference internal" href="#on.corpora.proposition.frame_set" title="on.corpora.proposition.frame_set"><tt class="xref py py-class docutils literal"><span class="pre">frame_set</span></tt></a> this leaf was annotated against</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.proposition.pb_sense_num">
<tt class="descname">pb_sense_num</tt><a class="headerlink" href="#on.corpora.proposition.proposition.pb_sense_num" title="Permalink to this definition">¶</a></dt>
<dd><p>Which sense in the <a class="reference internal" href="#on.corpora.proposition.frame_set" title="on.corpora.proposition.frame_set"><tt class="xref py py-class docutils literal"><span class="pre">frame_set</span></tt></a> the arguments are relative to</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.proposition.predicate">
<tt class="descname">predicate</tt><a class="headerlink" href="#on.corpora.proposition.proposition.predicate" title="Permalink to this definition">¶</a></dt>
<dd><p>A <a class="reference internal" href="#on.corpora.proposition.predicate_analogue" title="on.corpora.proposition.predicate_analogue"><tt class="xref py py-class docutils literal"><span class="pre">predicate_analogue</span></tt></a> instance</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.proposition.quality">
<tt class="descname">quality</tt><a class="headerlink" href="#on.corpora.proposition.proposition.quality" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>gold</dt>
<dd>double annotated, adjudicated, release format</dd>
<dt>pregold</dt>
<dd>double annotated, adjudicated, propbank-internal format</dd>
<dt>double</dt>
<dd>double annotated</dd>
<dt>single</dt>
<dd>single annotated</dd>
<dt>queue</dt>
<dd>ready to be annotated</dd>
</dl>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.proposition.type">
<tt class="descname">type</tt><a class="headerlink" href="#on.corpora.proposition.proposition.type" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>v</dt>
<dd>standard proposition</dd>
<dt>n</dt>
<dd>nominalization proposition</dd>
<dt>m</dt>
<dd>nombank proposition</dd>
</dl>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.proposition.argument_analogues">
<tt class="descname">argument_analogues</tt><a class="headerlink" href="#on.corpora.proposition.proposition.argument_analogues" title="Permalink to this definition">¶</a></dt>
<dd><p>A list of <a class="reference internal" href="#on.corpora.proposition.argument_analogue" title="on.corpora.proposition.argument_analogue"><tt class="xref py py-class docutils literal"><span class="pre">argument_analogue</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.proposition.link_analogue">
<tt class="descname">link_analogue</tt><a class="headerlink" href="#on.corpora.proposition.proposition.link_analogue" title="Permalink to this definition">¶</a></dt>
<dd><p>A list of <a class="reference internal" href="#on.corpora.proposition.link_analogue" title="on.corpora.proposition.link_analogue"><tt class="xref py py-class docutils literal"><span class="pre">link_analogue</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.proposition.document_id">
<tt class="descname">document_id</tt><a class="headerlink" href="#on.corpora.proposition.proposition.document_id" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.proposition.enc_prop">
<tt class="descname">enc_prop</tt><a class="headerlink" href="#on.corpora.proposition.proposition.enc_prop" title="Permalink to this definition">¶</a></dt>
<dd><p>This proposition and all it contains, encoded as a string.
Lines in the <tt class="docutils literal"><span class="pre">.prop</span></tt> files are in this format.</p>
</dd></dl>

</div></blockquote>
<p>Methods:</p>
<blockquote>
<div><dl class="method">
<dt id="on.corpora.proposition.proposition.write_to_db">
<tt class="descname">write_to_db</tt><big>(</big><em>cursor</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.proposition.write_to_db" title="Permalink to this definition">¶</a></dt>
<dd><p>write this proposition and all its components to the database</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.proposition.proposition.copy_to_different_trees">
<tt class="descname">copy_to_different_trees</tt><big>(</big><em>alignment_from_to</em>, <em>subcorpus_id</em>, <em>document_id</em>, <em>tag='gold'</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.proposition.copy_to_different_trees" title="Permalink to this definition">¶</a></dt>
<dd><p>create a duplicate of this proposition that is aligned with the <tt class="docutils literal"><span class="pre">to</span></tt> trees in <tt class="docutils literal"><span class="pre">alignment_from_to</span></tt></p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.proposition.proposition.__getitem__">
<tt class="descname">__getitem__</tt><big>(</big><em>idx</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.proposition.__getitem__" title="Permalink to this definition">¶</a></dt>
<dd><p>return first the predicate_analogue, then the argument analogues, then the link analogues</p>
</dd></dl>

<dl class="method">
<dt id="on.corpora.proposition.proposition.get_argument_tagged_string">
<tt class="descname">get_argument_tagged_string</tt><big>(</big><big>)</big><a class="headerlink" href="#on.corpora.proposition.proposition.get_argument_tagged_string" title="Permalink to this definition">¶</a></dt>
<dd><p>produce a sgml representation of this proposition</p>
<p>For example, the proposition with pointer:</p>
<div class="highlight-python"><pre>nw/wsj/12/wsj_1203@1203@wsj@nw@en@on 9 3 gold fall-v fall.01</pre>
</div>
<p>has the argument string:</p>
<div class="highlight-python"><pre>3:0-rel 1:1-ARG1 4:1-ARG4 7:1-ARGM-TMP 18:0*0:1-ARGM-TMP</pre>
</div>
<p>This translates into an argument tagged string of:</p>
<div class="highlight-python"><pre>DOMAIN/FRAME/fall.01.v.ar: &lt;S TPOS="3@9@nw/wsj/12/wsj_1203@1203@wsj@nw@en@on"&gt;
&lt;C FE="R-ARGM-TMP"&gt; When &lt;/C&gt; &lt;C FE="ARG1"&gt; the market &lt;/C&gt; &lt;C TARGET="y"&gt; fell &lt;/C&gt;
&lt;C FE="ARG4"&gt; below that level &lt;/C&gt; &lt;C FE="ARGM-TMP"&gt; on Monday &lt;/C&gt; and then
yesterday could n't climb above that level *T* , traders started * selling out
their positions . &lt;/S&gt;</pre>
</div>
<p>There are no newlines in the argument tagged string; the ones
in the example are added for readability.</p>
<p>The basic format is that &#8216;&#8217;&lt;S&gt;...&lt;/S&gt;&#8217;&#8217; sets off the sentence
while &#8216;&#8217;&lt;C&gt;...&lt;/C&gt;&#8217;&#8217; sets off annotations.  The &#8216;&#8217;S&#8217;&#8217; tag has
the attribute &#8216;&#8217;TPOS&#8217;&#8217; containing the tree id of the primary
predicate.  The &#8216;&#8217;C&#8217;&#8217; tags have either &#8216;&#8217;TARGET&#8217;&#8217; attributes
for predicates or &#8216;&#8217;FE&#8217;&#8217; attributes for arguments.  The value
of a &#8216;&#8217;TARGET&#8217;&#8217; is always &#8216;&#8217;y&#8217;&#8216;.</p>
<p>The value of the &#8216;&#8217;FE&#8217;&#8217; attribute is normally just the name of
the node, as in &#8216;ARG0&#8217;.  In the cases where this would create
multiple arguments, non &#8216;primary&#8217; arguments get &#8216;R-&#8216; and &#8216;C-&#8216;
prefixes.</p>
<p>Links are not included in this representation.  or, more
correctly, the propositions should be of the no_link form
before this method is used.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.abstract_proposition_bit">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">abstract_proposition_bit</tt><big>(</big><em>a_parent</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.abstract_proposition_bit" title="Permalink to this definition">¶</a></dt>
<dd><p>any subcomponent of a proposition after the &#8216;<tt class="docutils literal"><span class="pre">-----</span></tt>&#8216;.</p>
<p>Attributes:</p>
<blockquote>
<div><dl class="attribute">
<dt id="on.corpora.proposition.abstract_proposition_bit.id">
<tt class="descname">id</tt><a class="headerlink" href="#on.corpora.proposition.abstract_proposition_bit.id" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.abstract_proposition_bit.index_in_parent">
<tt class="descname">index_in_parent</tt><a class="headerlink" href="#on.corpora.proposition.abstract_proposition_bit.index_in_parent" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.abstract_proposition_bit.lemma">
<tt class="descname">lemma</tt><a class="headerlink" href="#on.corpora.proposition.abstract_proposition_bit.lemma" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.abstract_proposition_bit.pb_sense_num">
<tt class="descname">pb_sense_num</tt><a class="headerlink" href="#on.corpora.proposition.abstract_proposition_bit.pb_sense_num" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.abstract_proposition_bit.proposition">
<tt class="descname">proposition</tt><a class="headerlink" href="#on.corpora.proposition.abstract_proposition_bit.proposition" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.abstract_proposition_bit.document_id">
<tt class="descname">document_id</tt><a class="headerlink" href="#on.corpora.proposition.abstract_proposition_bit.document_id" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.abstract_proposition_bit.enc_self">
<tt class="descname">enc_self</tt><a class="headerlink" href="#on.corpora.proposition.abstract_proposition_bit.enc_self" title="Permalink to this definition">¶</a></dt>
<dd><p>Encode whatever we represent as a string, generally by
combining the encoded representations of sub-components</p>
</dd></dl>

</div></blockquote>
<p>Class Hierarchy:</p>
<blockquote>
<div><ul>
<li><p class="first"><a class="reference internal" href="#on.corpora.proposition.abstract_proposition_bit" title="on.corpora.proposition.abstract_proposition_bit"><tt class="xref py py-class docutils literal"><span class="pre">abstract_proposition_bit</span></tt></a> &#8211; things with parents</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.proposition.abstract_node" title="on.corpora.proposition.abstract_node"><tt class="xref py py-class docutils literal"><span class="pre">abstract_node</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.abstract_holder" title="on.corpora.proposition.abstract_holder"><tt class="xref py py-class docutils literal"><span class="pre">abstract_holder</span></tt></a></li>
</ul>
</div></blockquote>
</li>
<li><p class="first"><a class="reference internal" href="#on.corpora.proposition.abstract_node" title="on.corpora.proposition.abstract_node"><tt class="xref py py-class docutils literal"><span class="pre">abstract_node</span></tt></a> &#8211; things that align with subtrees</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.proposition.argument_node" title="on.corpora.proposition.argument_node"><tt class="xref py py-class docutils literal"><span class="pre">argument_node</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.predicate_node" title="on.corpora.proposition.predicate_node"><tt class="xref py py-class docutils literal"><span class="pre">predicate_node</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.link_node" title="on.corpora.proposition.link_node"><tt class="xref py py-class docutils literal"><span class="pre">link_node</span></tt></a></li>
</ul>
</div></blockquote>
</li>
<li><p class="first"><a class="reference internal" href="#on.corpora.proposition.abstract_holder" title="on.corpora.proposition.abstract_holder"><tt class="xref py py-class docutils literal"><span class="pre">abstract_holder</span></tt></a> &#8211; things with children</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.proposition.abstract_analogue" title="on.corpora.proposition.abstract_analogue"><tt class="xref py py-class docutils literal"><span class="pre">abstract_analogue</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.abstract_node_holder" title="on.corpora.proposition.abstract_node_holder"><tt class="xref py py-class docutils literal"><span class="pre">abstract_node_holder</span></tt></a></li>
</ul>
</div></blockquote>
</li>
<li><p class="first"><a class="reference internal" href="#on.corpora.proposition.abstract_analogue" title="on.corpora.proposition.abstract_analogue"><tt class="xref py py-class docutils literal"><span class="pre">abstract_analogue</span></tt></a> &#8211; children are coreferential (split on &#8216;*&#8217;)</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.proposition.argument_analogue" title="on.corpora.proposition.argument_analogue"><tt class="xref py py-class docutils literal"><span class="pre">argument_analogue</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.predicate_analogue" title="on.corpora.proposition.predicate_analogue"><tt class="xref py py-class docutils literal"><span class="pre">predicate_analogue</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.link_analogue" title="on.corpora.proposition.link_analogue"><tt class="xref py py-class docutils literal"><span class="pre">link_analogue</span></tt></a></li>
</ul>
</div></blockquote>
</li>
<li><p class="first"><a class="reference internal" href="#on.corpora.proposition.abstract_node_holder" title="on.corpora.proposition.abstract_node_holder"><tt class="xref py py-class docutils literal"><span class="pre">abstract_node_holder</span></tt></a> &#8211; children together make up an entity (split on &#8216;,&#8217;)</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.proposition.argument" title="on.corpora.proposition.argument"><tt class="xref py py-class docutils literal"><span class="pre">argument</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.predicate" title="on.corpora.proposition.predicate"><tt class="xref py py-class docutils literal"><span class="pre">predicate</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.link" title="on.corpora.proposition.link"><tt class="xref py py-class docutils literal"><span class="pre">link</span></tt></a></li>
</ul>
</div></blockquote>
</li>
</ul>
</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.abstract_holder">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">abstract_holder</tt><big>(</big><em>sep</em>, <em>a_parent</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.abstract_holder" title="Permalink to this definition">¶</a></dt>
<dd><p>represents any proposition bit that holds other proposition bits</p>
<p>Extends <a class="reference internal" href="#on.corpora.proposition.abstract_proposition_bit" title="on.corpora.proposition.abstract_proposition_bit"><tt class="xref py py-class docutils literal"><span class="pre">abstract_proposition_bit</span></tt></a></p>
<p>See:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.proposition.abstract_analogue" title="on.corpora.proposition.abstract_analogue"><tt class="xref py py-class docutils literal"><span class="pre">abstract_analogue</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.abstract_node_holder" title="on.corpora.proposition.abstract_node_holder"><tt class="xref py py-class docutils literal"><span class="pre">abstract_node_holder</span></tt></a></li>
</ul>
</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.abstract_analogue">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">abstract_analogue</tt><big>(</big><em>a_parent</em>, <em>a_analogue_type</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.abstract_analogue" title="Permalink to this definition">¶</a></dt>
<dd><p>represents argument_analogue, predicate_analogue, link_analogue</p>
<p>Example: <tt class="docutils literal"><span class="pre">0:1,3:2*2:0-ARGM</span></tt></p>
<p>Extends: <a class="reference internal" href="#on.corpora.proposition.abstract_holder" title="on.corpora.proposition.abstract_holder"><tt class="xref py py-class docutils literal"><span class="pre">abstract_holder</span></tt></a></p>
<p>Represents:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.proposition.argument_analogue" title="on.corpora.proposition.argument_analogue"><tt class="xref py py-class docutils literal"><span class="pre">argument_analogue</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.predicate_analogue" title="on.corpora.proposition.predicate_analogue"><tt class="xref py py-class docutils literal"><span class="pre">predicate_analogue</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.link_analogue" title="on.corpora.proposition.link_analogue"><tt class="xref py py-class docutils literal"><span class="pre">link_analogue</span></tt></a></li>
</ul>
</div></blockquote>
<p>This class is used for the space separated portions of a
proposition after the &#8216;<tt class="docutils literal"><span class="pre">-----</span></tt>&#8216;</p>
<p>All children are coreferential, and usually all but one are traces.</p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.abstract_node_holder">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">abstract_node_holder</tt><big>(</big><em>a_parent</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.abstract_node_holder" title="Permalink to this definition">¶</a></dt>
<dd><p>represents argument, predicate, link</p>
<p>Example: <tt class="docutils literal"><span class="pre">0:1,3:2</span></tt></p>
<p>Extends: <a class="reference internal" href="#on.corpora.proposition.abstract_holder" title="on.corpora.proposition.abstract_holder"><tt class="xref py py-class docutils literal"><span class="pre">abstract_holder</span></tt></a></p>
<p>Represents:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.proposition.argument" title="on.corpora.proposition.argument"><tt class="xref py py-class docutils literal"><span class="pre">argument</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.predicate" title="on.corpora.proposition.predicate"><tt class="xref py py-class docutils literal"><span class="pre">predicate</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.link" title="on.corpora.proposition.link"><tt class="xref py py-class docutils literal"><span class="pre">link</span></tt></a></li>
</ul>
</div></blockquote>
<p>This class is used for any bit of a proposition which has
representation A,B where A and B are nodes</p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.abstract_node">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">abstract_node</tt><big>(</big><em>sentence_index</em>, <em>token_index</em>, <em>height</em>, <em>parent</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.abstract_node" title="Permalink to this definition">¶</a></dt>
<dd><p>represents argument_node, predicate_node, and link_node</p>
<p>Example: <tt class="docutils literal"><span class="pre">0:1</span></tt></p>
<p>Extends: <a class="reference internal" href="#on.corpora.proposition.abstract_proposition_bit" title="on.corpora.proposition.abstract_proposition_bit"><tt class="xref py py-class docutils literal"><span class="pre">abstract_proposition_bit</span></tt></a></p>
<p>Represents:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.proposition.argument_node" title="on.corpora.proposition.argument_node"><tt class="xref py py-class docutils literal"><span class="pre">argument_node</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.predicate_node" title="on.corpora.proposition.predicate_node"><tt class="xref py py-class docutils literal"><span class="pre">predicate_node</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.proposition.link_node" title="on.corpora.proposition.link_node"><tt class="xref py py-class docutils literal"><span class="pre">link_node</span></tt></a></li>
</ul>
</div></blockquote>
<p>This class is used for any bit of a proposition which has representation A:B</p>
<p>Attributes:</p>
<blockquote>
<div><dl class="attribute">
<dt id="on.corpora.proposition.abstract_node.sentence_index">
<tt class="descname">sentence_index</tt><a class="headerlink" href="#on.corpora.proposition.abstract_node.sentence_index" title="Permalink to this definition">¶</a></dt>
<dd><p>which tree we&#8217;re in</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.abstract_node.token_index">
<tt class="descname">token_index</tt><a class="headerlink" href="#on.corpora.proposition.abstract_node.token_index" title="Permalink to this definition">¶</a></dt>
<dd><p>which leaf in the tree we are</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.abstract_node.height">
<tt class="descname">height</tt><a class="headerlink" href="#on.corpora.proposition.abstract_node.height" title="Permalink to this definition">¶</a></dt>
<dd><p>how far up from the leaves we are (a leaf is height 0)</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.abstract_node.parent">
<tt class="descname">parent</tt><a class="headerlink" href="#on.corpora.proposition.abstract_node.parent" title="Permalink to this definition">¶</a></dt>
<dd><p>an abstract_node_holder to add yourself to</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.abstract_node.subtree">
<tt class="descname">subtree</tt><a class="headerlink" href="#on.corpora.proposition.abstract_node.subtree" title="Permalink to this definition">¶</a></dt>
<dd><p>which <a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a> we&#8217;re aligned to.  None until enrichment.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.abstract_node.is_ich_node">
<tt class="descname">is_ich_node</tt><a class="headerlink" href="#on.corpora.proposition.abstract_node.is_ich_node" title="Permalink to this definition">¶</a></dt>
<dd><p><tt class="docutils literal"><span class="pre">True</span></tt> only for argument nodes.  <tt class="docutils literal"><span class="pre">True</span></tt> when proposition
taggers would separate this node from others with a &#8216;<tt class="docutils literal"><span class="pre">;</span></tt>&#8216;
in the encoded form.  That is, <tt class="docutils literal"><span class="pre">True</span></tt> if the subtree we
are attached to is indexed to an <tt class="docutils literal"><span class="pre">*ICH*</span></tt> leaf or we have
an <tt class="docutils literal"><span class="pre">*ICH*</span></tt> leaf among our leaves, <tt class="docutils literal"><span class="pre">False</span></tt> otherwise.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.abstract_node.errcomms">
<tt class="descname">errcomms</tt><a class="headerlink" href="#on.corpora.proposition.abstract_node.errcomms" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a list, by default the empty list.  If errors are
found in loading this proposition, strings that can be
passed to <tt class="xref py py-func docutils literal"><span class="pre">on.common.log.reject()</span></tt> or
<tt class="xref py py-func docutils literal"><span class="pre">on.common.log.adjust()</span></tt> are appended to it along with
comments, like:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">errcomms</span><span class="o">.</span><span class="n">append</span><span class="p">([</span><span class="s">&#39;reason&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s">&#39;explanation&#39;</span><span class="p">,</span> <span class="s">&#39;details&#39;</span><span class="p">,</span> <span class="o">...</span><span class="p">]])</span>
</pre></div>
</div>
</dd></dl>

</div></blockquote>
<p>Initially, a node is created with sentence and token indecies.
During enrichment we gain a reference to a
<a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a> instance.  After enrichment,
requests for sentence and token indecies are forwarded to the
subtree.</p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.predicate_analogue">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">predicate_analogue</tt><big>(</big><em>enc_predicates</em>, <em>a_type</em>, <em>sentence_index</em>, <em>token_index</em>, <em>a_proposition</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.predicate_analogue" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">REL</span></tt>-tagged field of a proposition.</p>
<p>Extends: <a class="reference internal" href="#on.corpora.proposition.abstract_analogue" title="on.corpora.proposition.abstract_analogue"><tt class="xref py py-class docutils literal"><span class="pre">abstract_analogue</span></tt></a></p>
<p>Contained by: <a class="reference internal" href="#on.corpora.proposition.proposition" title="on.corpora.proposition.proposition"><tt class="xref py py-class docutils literal"><span class="pre">proposition</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.proposition.predicate" title="on.corpora.proposition.predicate"><tt class="xref py py-class docutils literal"><span class="pre">predicate</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.predicate">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">predicate</tt><big>(</big><em>enc_predicate</em>, <em>sentence_index</em>, <em>token_index</em>, <em>a_predicate_analogue</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.predicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Extends: <a class="reference internal" href="#on.corpora.proposition.abstract_node_holder" title="on.corpora.proposition.abstract_node_holder"><tt class="xref py py-class docutils literal"><span class="pre">abstract_node_holder</span></tt></a></p>
<p>Contained by: <a class="reference internal" href="#on.corpora.proposition.predicate_analogue" title="on.corpora.proposition.predicate_analogue"><tt class="xref py py-class docutils literal"><span class="pre">predicate_analogue</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.proposition.predicate_node" title="on.corpora.proposition.predicate_node"><tt class="xref py py-class docutils literal"><span class="pre">predicate_node</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.predicate_node">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">predicate_node</tt><big>(</big><em>sentence_index</em>, <em>token_index</em>, <em>height</em>, <em>a_predicate</em>, <em>primary=False</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.predicate_node" title="Permalink to this definition">¶</a></dt>
<dd><p>represents the different nodes of a multi-word predicate</p>
<p>Extends: <a class="reference internal" href="#on.corpora.proposition.abstract_node" title="on.corpora.proposition.abstract_node"><tt class="xref py py-class docutils literal"><span class="pre">abstract_node</span></tt></a></p>
<p>Contained by: <a class="reference internal" href="#on.corpora.proposition.predicate" title="on.corpora.proposition.predicate"><tt class="xref py py-class docutils literal"><span class="pre">predicate</span></tt></a></p>
<p>Attributes:</p>
<blockquote>
<div><dl class="attribute">
<dt id="on.corpora.proposition.predicate_node.a_predicate">
<tt class="descname">a_predicate</tt><a class="headerlink" href="#on.corpora.proposition.predicate_node.a_predicate" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#on.corpora.proposition.predicate" title="on.corpora.proposition.predicate"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.proposition.predicate</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.predicate_node.sentence_index">
<tt class="descname">sentence_index</tt><a class="headerlink" href="#on.corpora.proposition.predicate_node.sentence_index" title="Permalink to this definition">¶</a></dt>
<dd><p>which tree in the document do we belong to</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.predicate_node.token_index">
<tt class="descname">token_index</tt><a class="headerlink" href="#on.corpora.proposition.predicate_node.token_index" title="Permalink to this definition">¶</a></dt>
<dd><p>token index of this node within the predicate&#8217;s tree</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.predicate_node.height">
<tt class="descname">height</tt><a class="headerlink" href="#on.corpora.proposition.predicate_node.height" title="Permalink to this definition">¶</a></dt>
<dd><p>how far up in the tree from the leaf at token_index we need to
go to get the subtree this node represents</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.proposition.predicate_node.primary">
<tt class="descname">primary</tt><a class="headerlink" href="#on.corpora.proposition.predicate_node.primary" title="Permalink to this definition">¶</a></dt>
<dd><p>are we the primary predicate?</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.argument_analogue">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">argument_analogue</tt><big>(</big><em>enc_argument_analogue</em>, <em>a_proposition</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.argument_analogue" title="Permalink to this definition">¶</a></dt>
<dd><p>Extends: <a class="reference internal" href="#on.corpora.proposition.abstract_analogue" title="on.corpora.proposition.abstract_analogue"><tt class="xref py py-class docutils literal"><span class="pre">abstract_analogue</span></tt></a></p>
<p>Contained by: <a class="reference internal" href="#on.corpora.proposition.proposition" title="on.corpora.proposition.proposition"><tt class="xref py py-class docutils literal"><span class="pre">proposition</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.proposition.argument" title="on.corpora.proposition.argument"><tt class="xref py py-class docutils literal"><span class="pre">argument</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.argument">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">argument</tt><big>(</big><em>enc_argument</em>, <em>a_argument_analogue</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.argument" title="Permalink to this definition">¶</a></dt>
<dd><p>Extends: <a class="reference internal" href="#on.corpora.proposition.abstract_node_holder" title="on.corpora.proposition.abstract_node_holder"><tt class="xref py py-class docutils literal"><span class="pre">abstract_node_holder</span></tt></a></p>
<p>Contained by: <a class="reference internal" href="#on.corpora.proposition.argument_analogue" title="on.corpora.proposition.argument_analogue"><tt class="xref py py-class docutils literal"><span class="pre">argument_analogue</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.proposition.argument_node" title="on.corpora.proposition.argument_node"><tt class="xref py py-class docutils literal"><span class="pre">argument_node</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.argument_node">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">argument_node</tt><big>(</big><em>sentence_index</em>, <em>token_index</em>, <em>height</em>, <em>a_argument</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.argument_node" title="Permalink to this definition">¶</a></dt>
<dd><p>Extends: <a class="reference internal" href="#on.corpora.proposition.abstract_node" title="on.corpora.proposition.abstract_node"><tt class="xref py py-class docutils literal"><span class="pre">abstract_node</span></tt></a></p>
<p>Contained by: <a class="reference internal" href="#on.corpora.proposition.argument" title="on.corpora.proposition.argument"><tt class="xref py py-class docutils literal"><span class="pre">argument</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.link_analogue">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">link_analogue</tt><big>(</big><em>enc_links</em>, <em>a_type</em>, <em>a_proposition</em>, <em>a_associated_argument</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.link_analogue" title="Permalink to this definition">¶</a></dt>
<dd><p>Extends: <a class="reference internal" href="#on.corpora.proposition.abstract_analogue" title="on.corpora.proposition.abstract_analogue"><tt class="xref py py-class docutils literal"><span class="pre">abstract_analogue</span></tt></a></p>
<p>Contained by: <a class="reference internal" href="#on.corpora.proposition.proposition" title="on.corpora.proposition.proposition"><tt class="xref py py-class docutils literal"><span class="pre">proposition</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.proposition.link" title="on.corpora.proposition.link"><tt class="xref py py-class docutils literal"><span class="pre">link</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.link">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">link</tt><big>(</big><em>enc_link</em>, <em>a_link_analogue</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.link" title="Permalink to this definition">¶</a></dt>
<dd><p>Extends: <a class="reference internal" href="#on.corpora.proposition.abstract_node_holder" title="on.corpora.proposition.abstract_node_holder"><tt class="xref py py-class docutils literal"><span class="pre">abstract_node_holder</span></tt></a></p>
<p>Contained by: <a class="reference internal" href="#on.corpora.proposition.link_analogue" title="on.corpora.proposition.link_analogue"><tt class="xref py py-class docutils literal"><span class="pre">link_analogue</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.proposition.link_node" title="on.corpora.proposition.link_node"><tt class="xref py py-class docutils literal"><span class="pre">link_node</span></tt></a></p>
<p>Attributes:</p>
<blockquote>
<div><dl class="attribute">
<dt id="on.corpora.proposition.link.associated_argument">
<tt class="descname">associated_argument</tt><a class="headerlink" href="#on.corpora.proposition.link.associated_argument" title="Permalink to this definition">¶</a></dt>
<dd><p>the <a class="reference internal" href="#on.corpora.proposition.argument_analogue" title="on.corpora.proposition.argument_analogue"><tt class="xref py py-class docutils literal"><span class="pre">argument_analogue</span></tt></a> this link is providing additional detail for</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.link_node">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">link_node</tt><big>(</big><em>sentence_index</em>, <em>token_index</em>, <em>height</em>, <em>parent</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.link_node" title="Permalink to this definition">¶</a></dt>
<dd><p>Extends: <a class="reference internal" href="#on.corpora.proposition.abstract_node" title="on.corpora.proposition.abstract_node"><tt class="xref py py-class docutils literal"><span class="pre">abstract_node</span></tt></a></p>
<p>Contained by: <a class="reference internal" href="#on.corpora.proposition.link" title="on.corpora.proposition.link"><tt class="xref py py-class docutils literal"><span class="pre">link</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.proposition.frame_set">
<em class="property">class </em><tt class="descclassname">on.corpora.proposition.</tt><tt class="descname">frame_set</tt><big>(</big><em>a_xml_string</em>, <em>a_subcorpus=None</em>, <em>lang_id=None</em><big>)</big><a class="headerlink" href="#on.corpora.proposition.frame_set" title="Permalink to this definition">¶</a></dt>
<dd><p>information for interpreting a proposition annotation</p>
</dd></dl>

</div>
<span class="target" id="module-on.corpora.sense"></span><div class="section" id="sense-word-sense-annotation">
<h2><tt class="xref py py-mod docutils literal"><span class="pre">sense</span></tt> &#8211; Word Sense Annotation<a class="headerlink" href="#sense-word-sense-annotation" title="Permalink to this headline">¶</a></h2>
<p>See:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.sense.on_sense" title="on.corpora.sense.on_sense"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.sense.on_sense</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.sense.sense_bank" title="on.corpora.sense.sense_bank"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.sense.sense_bank</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.sense.on_sense_type" title="on.corpora.sense.on_sense_type"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.sense.on_sense_type</span></tt></a></li>
</ul>
</div></blockquote>
<p>Word sense annotation consists of specifying which sense a word is
being used in.  In the <tt class="docutils literal"><span class="pre">.sense</span></tt> file format, a word sense would
be annotated as:</p>
<p>This tells us that word 9 of sentence 6 in broadcast news document
cnn_0001 has the lemma &#8220;fire&#8221;, is a noun, and has sense 4.  The
sense numbers, such as 4, are defined in the sense inventory files.
Looking up sense 4 of fire-n in
<tt class="docutils literal"><span class="pre">data/english/metadata/sense-inventories/fire-n.xml</span></tt>, we see:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;sense</span> <span class="na">n=</span><span class="s">&quot;4&quot;</span> <span class="na">type=</span><span class="s">&quot;Event&quot;</span> <span class="na">name=</span><span class="s">&quot;the discharge of a gun&quot;</span> <span class="na">group=</span><span class="s">&quot;1&quot;</span><span class="nt">&gt;</span>
  <span class="nt">&lt;commentary&gt;</span>
    FIRE[+event][+physical][+discharge][+gun]
    The event of a gun going off.
  <span class="nt">&lt;/commentary&gt;</span>
  <span class="nt">&lt;examples&gt;</span>
    Hold your fire until you see the whites of their eyes.
    He ran straight into enemy fire.
    The marines came under heavy fire when they stormed the hill.
  <span class="nt">&lt;/examples&gt;</span>
  <span class="nt">&lt;mappings&gt;&lt;wn</span> <span class="na">version=</span><span class="s">&quot;2.1&quot;</span><span class="nt">&gt;</span>2<span class="nt">&lt;/wn&gt;&lt;omega&gt;&lt;/omega&gt;&lt;pb&gt;&lt;/pb&gt;&lt;/mappings&gt;</span>
  <span class="nt">&lt;SENSE_META</span> <span class="na">clarity=</span><span class="s">&quot;&quot;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/sense&gt;</span>
</pre></div>
</div>
<p>Just knowing that word 9 of sentence 6 in some document has some
sense is not very useful on its own.  We need to match this data
with the document it was annotated against.  The python code can do
this for you.  First, load the data you&#8217;re interested in, to memory
with <tt class="xref py py-mod docutils literal"><span class="pre">on.corpora.tools.load_to_memory</span></tt>.  Then we can
iterate over all the leaves to look for cases where a_leaf was
tagged with a noun sense &#8220;fire&#8221;:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">fire_n_leaves</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">a_subcorpus</span> <span class="ow">in</span> <span class="n">a_ontonotes</span><span class="p">:</span>
   <span class="k">for</span> <span class="n">a_tree_document</span> <span class="ow">in</span> <span class="n">a_subcorpus</span><span class="p">[</span><span class="s">&quot;tree&quot;</span><span class="p">]:</span>
      <span class="k">for</span> <span class="n">a_tree</span> <span class="ow">in</span> <span class="n">a_tree_document</span><span class="p">:</span>
         <span class="k">for</span> <span class="n">a_leaf</span> <span class="ow">in</span> <span class="n">a_tree</span><span class="o">.</span><span class="n">leaves</span><span class="p">():</span>
            <span class="k">if</span> <span class="n">a_leaf</span><span class="o">.</span><span class="n">on_sense</span><span class="p">:</span> <span class="c"># whether the leaf is sense tagged</span>
               <span class="k">if</span> <span class="n">a_leaf</span><span class="o">.</span><span class="n">on_sense</span><span class="o">.</span><span class="n">lemma</span> <span class="o">==</span> <span class="s">&quot;fire&quot;</span> <span class="ow">and</span> <span class="n">a_leaf</span><span class="o">.</span><span class="n">on_sense</span><span class="o">.</span><span class="n">pos</span> <span class="o">==</span> <span class="s">&quot;n&quot;</span><span class="p">:</span>
                  <span class="n">fire_n_leaves</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">a_leaf</span><span class="p">)</span>
</pre></div>
</div>
<p>Now say we want to print the sentences for each tagged example of
&#8220;fire-n&#8221;:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># first we collect all the sentences for each sense of fire</span>
<span class="n">sense_to_sentences</span> <span class="o">=</span> <span class="n">defaultdict</span><span class="p">(</span><span class="nb">list</span><span class="p">)</span>
<span class="k">for</span> <span class="n">a_leaf</span> <span class="ow">in</span> <span class="n">fire_n_leaves</span><span class="p">:</span>
   <span class="n">a_sense</span> <span class="o">=</span> <span class="n">a_leaf</span><span class="o">.</span><span class="n">on_sense</span><span class="o">.</span><span class="n">sense</span>
   <span class="n">a_sentence</span> <span class="o">=</span> <span class="n">a_leaf</span><span class="o">.</span><span class="n">get_root</span><span class="p">()</span><span class="o">.</span><span class="n">get_word_string</span><span class="p">()</span>
   <span class="n">sense_to_sentences</span><span class="p">[</span><span class="n">a_sense</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">a_sentence</span><span class="p">)</span>

<span class="c"># then we print them</span>
<span class="k">for</span> <span class="n">a_sense</span><span class="p">,</span> <span class="n">sentences</span> <span class="ow">in</span> <span class="n">sense_to_sentences</span><span class="o">.</span><span class="n">iteritems</span><span class="p">():</span>
   <span class="n">a_sense_name</span> <span class="o">=</span> <span class="n">on_sense_type</span><span class="o">.</span><span class="n">get_name</span><span class="p">(</span><span class="s">&quot;fire&quot;</span><span class="p">,</span> <span class="s">&quot;n&quot;</span><span class="p">,</span> <span class="n">a_sense</span><span class="p">)</span>

   <span class="k">print</span> <span class="s">&quot;Sense </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">a_sense</span><span class="p">,</span> <span class="n">a_sense_name</span><span class="p">)</span>
   <span class="k">for</span> <span class="n">a_sentence</span> <span class="ow">in</span> <span class="n">sentences</span><span class="p">:</span>
      <span class="k">print</span> <span class="s">&quot;  &quot;</span><span class="p">,</span> <span class="n">a_sentence</span>

   <span class="k">print</span> <span class="s">&quot;&quot;</span>
</pre></div>
</div>
<p>Correspondences:</p>
<blockquote>
<div><table border="1" class="docutils">
<colgroup>
<col width="21%" />
<col width="21%" />
<col width="58%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head"><strong>Database Tables</strong></th>
<th class="head"><strong>Python Objects</strong></th>
<th class="head"><strong>File Elements</strong></th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">sense_bank</span></tt></td>
<td><a class="reference internal" href="#on.corpora.sense.sense_bank" title="on.corpora.sense.sense_bank"><tt class="xref py py-class docutils literal"><span class="pre">sense_bank</span></tt></a></td>
<td>All <tt class="docutils literal"><span class="pre">.sense</span></tt> files in a <a class="reference internal" href="#on.corpora.subcorpus" title="on.corpora.subcorpus"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.subcorpus</span></tt></a></td>
</tr>
<tr class="row-odd"><td>None</td>
<td><a class="reference internal" href="#on.corpora.sense.sense_tagged_document" title="on.corpora.sense.sense_tagged_document"><tt class="xref py py-class docutils literal"><span class="pre">sense_tagged_document</span></tt></a></td>
<td>A single <tt class="docutils literal"><span class="pre">.sense</span></tt> file</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">on_sense</span></tt></td>
<td><a class="reference internal" href="#on.corpora.sense.on_sense" title="on.corpora.sense.on_sense"><tt class="xref py py-class docutils literal"><span class="pre">on_sense</span></tt></a></td>
<td>A line in a <tt class="docutils literal"><span class="pre">.sense</span></tt> file</td>
</tr>
<tr class="row-odd"><td>None</td>
<td><a class="reference internal" href="#on.corpora.sense.sense_inventory" title="on.corpora.sense.sense_inventory"><tt class="xref py py-class docutils literal"><span class="pre">sense_inventory</span></tt></a></td>
<td>A sense inventory xml file (SI)</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">on_sense_type</span></tt></td>
<td><a class="reference internal" href="#on.corpora.sense.on_sense_type" title="on.corpora.sense.on_sense_type"><tt class="xref py py-class docutils literal"><span class="pre">on_sense_type</span></tt></a></td>
<td>Fields four and six of a sense line and the <tt class="docutils literal"><span class="pre">inventory/sense</span></tt> element of a SI</td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">on_sense_lemma_type</span></tt></td>
<td><a class="reference internal" href="#on.corpora.sense.on_sense_lemma_type" title="on.corpora.sense.on_sense_lemma_type"><tt class="xref py py-class docutils literal"><span class="pre">on_sense_lemma_type</span></tt></a></td>
<td>The <tt class="docutils literal"><span class="pre">inventory/ita</span></tt> element of a SI</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">wn_sense_type</span></tt></td>
<td><a class="reference internal" href="#on.corpora.sense.wn_sense_type" title="on.corpora.sense.wn_sense_type"><tt class="xref py py-class docutils literal"><span class="pre">wn_sense_type</span></tt></a></td>
<td>The <tt class="docutils literal"><span class="pre">inventory/sense/mappings/wn</span></tt> element of a SI</td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">pb_sense_type</span></tt></td>
<td><a class="reference internal" href="#on.corpora.sense.pb_sense_type" title="on.corpora.sense.pb_sense_type"><tt class="xref py py-class docutils literal"><span class="pre">pb_sense_type</span></tt></a></td>
<td>The <tt class="docutils literal"><span class="pre">inventory/sense/mappings/pb</span></tt> element of a SI</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">tree</span></tt></td>
<td><a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a></td>
<td>The first three fields of a sense line</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>Classes:</p>
<dl class="class">
<dt id="on.corpora.sense.sense_bank">
<em class="property">class </em><tt class="descclassname">on.corpora.sense.</tt><tt class="descname">sense_bank</tt><big>(</big><em>a_subcorpus</em>, <em>tag</em>, <em>a_cursor=None</em>, <em>extension='sense'</em>, <em>a_sense_inv_hash=None</em>, <em>a_frame_set_hash=None</em>, <em>indexing='word'</em><big>)</big><a class="headerlink" href="#on.corpora.sense.sense_bank" title="Permalink to this definition">¶</a></dt>
<dd><p>Extends: <a class="reference internal" href="#on.corpora.abstract_bank" title="on.corpora.abstract_bank"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.abstract_bank</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.sense.sense_tagged_document" title="on.corpora.sense.sense_tagged_document"><tt class="xref py py-class docutils literal"><span class="pre">sense_tagged_document</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.sense.sense_tagged_document">
<em class="property">class </em><tt class="descclassname">on.corpora.sense.</tt><tt class="descname">sense_tagged_document</tt><big>(</big><em>sense_tagged_document_string</em>, <em>document_id</em>, <em>a_sense_bank</em>, <em>a_cursor=None</em>, <em>preserve_ita=False</em>, <em>indexing='word'</em><big>)</big><a class="headerlink" href="#on.corpora.sense.sense_tagged_document" title="Permalink to this definition">¶</a></dt>
<dd><p>Contained by: <a class="reference internal" href="#on.corpora.sense.sense_bank" title="on.corpora.sense.sense_bank"><tt class="xref py py-class docutils literal"><span class="pre">sense_bank</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.sense.on_sense" title="on.corpora.sense.on_sense"><tt class="xref py py-class docutils literal"><span class="pre">on_sense</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.sense.on_sense">
<em class="property">class </em><tt class="descclassname">on.corpora.sense.</tt><tt class="descname">on_sense</tt><big>(</big><em>document_id</em>, <em>tree_index</em>, <em>word_index</em>, <em>lemma</em>, <em>pos</em>, <em>ann_1_sense</em>, <em>ann_2_sense</em>, <em>adj_sense</em>, <em>sense</em>, <em>adjudicated_flag</em>, <em>a_cursor=None</em>, <em>indexing='word'</em><big>)</big><a class="headerlink" href="#on.corpora.sense.on_sense" title="Permalink to this definition">¶</a></dt>
<dd><p>A sense annotation; a line in a <tt class="docutils literal"><span class="pre">.sense</span></tt> file.</p>
<p>Contained by: <a class="reference internal" href="#on.corpora.sense.sense_tagged_document" title="on.corpora.sense.sense_tagged_document"><tt class="xref py py-class docutils literal"><span class="pre">sense_tagged_document</span></tt></a></p>
<p>Attributes:</p>
<blockquote>
<div><dl class="attribute">
<dt id="on.corpora.sense.on_sense.lemma">
<tt class="descname">lemma</tt><a class="headerlink" href="#on.corpora.sense.on_sense.lemma" title="Permalink to this definition">¶</a></dt>
<dd><p>Together with the <a class="reference internal" href="#on.corpora.sense.on_sense.pos" title="on.corpora.sense.on_sense.pos"><tt class="xref py py-attr docutils literal"><span class="pre">pos</span></tt></a> , a reference to a
<a class="reference internal" href="#on.corpora.sense.sense_inventory" title="on.corpora.sense.sense_inventory"><tt class="xref py py-class docutils literal"><span class="pre">sense_inventory</span></tt></a> .</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.sense.on_sense.pos">
<tt class="descname">pos</tt><a class="headerlink" href="#on.corpora.sense.on_sense.pos" title="Permalink to this definition">¶</a></dt>
<dd><p>Either <tt class="docutils literal"><span class="pre">n</span></tt> or <tt class="docutils literal"><span class="pre">v</span></tt>.  Indicates whether this leaf was annotated
by people who primarily tagged nouns or verbs.  This should
agree with <a class="reference internal" href="#on.corpora.tree.tree.is_noun" title="on.corpora.tree.tree.is_noun"><tt class="xref py py-meth docutils literal"><span class="pre">on.corpora.tree.tree.is_noun()</span></tt></a> and
<a class="reference internal" href="#on.corpora.tree.tree.is_verb" title="on.corpora.tree.tree.is_verb"><tt class="xref py py-meth docutils literal"><span class="pre">is_verb()</span></tt></a> methods for English and Arabic,
but not Chinese.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.sense.on_sense.sense">
<tt class="descname">sense</tt><a class="headerlink" href="#on.corpora.sense.on_sense.sense" title="Permalink to this definition">¶</a></dt>
<dd><p>Which sense in the <a class="reference internal" href="#on.corpora.sense.sense_inventory" title="on.corpora.sense.sense_inventory"><tt class="xref py py-class docutils literal"><span class="pre">sense_inventory</span></tt></a> the annotators gave
this leaf.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="on.corpora.sense.on_sense_type">
<em class="property">class </em><tt class="descclassname">on.corpora.sense.</tt><tt class="descname">on_sense_type</tt><big>(</big><em>lemma</em>, <em>pos</em>, <em>group</em>, <em>sense_num</em>, <em>name</em>, <em>sense_type</em><big>)</big><a class="headerlink" href="#on.corpora.sense.on_sense_type" title="Permalink to this definition">¶</a></dt>
<dd><p>Information to interpret <a class="reference internal" href="#on.corpora.sense.on_sense" title="on.corpora.sense.on_sense"><tt class="xref py py-class docutils literal"><span class="pre">on_sense</span></tt></a> annotations</p>
<p>Contained by: <a class="reference internal" href="#on.corpora.sense.sense_inventory" title="on.corpora.sense.sense_inventory"><tt class="xref py py-class docutils literal"><span class="pre">sense_inventory</span></tt></a></p>
<p>Attributes:</p>
<blockquote>
<div><dl class="attribute">
<dt id="on.corpora.sense.on_sense_type.lemma">
<tt class="descname">lemma</tt><a class="headerlink" href="#on.corpora.sense.on_sense_type.lemma" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.sense.on_sense_type.sense_num">
<tt class="descname">sense_num</tt><a class="headerlink" href="#on.corpora.sense.on_sense_type.sense_num" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.sense.on_sense_type.pos">
<tt class="descname">pos</tt><a class="headerlink" href="#on.corpora.sense.on_sense_type.pos" title="Permalink to this definition">¶</a></dt>
<dd><p>Either &#8216;n&#8217; or &#8216;v&#8217;, depending on whether this is a noun sense or a verb sense.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.sense.on_sense_type.wn_sense_types">
<tt class="descname">wn_sense_types</tt><a class="headerlink" href="#on.corpora.sense.on_sense_type.wn_sense_types" title="Permalink to this definition">¶</a></dt>
<dd><p>list of <a class="reference internal" href="#on.corpora.sense.wn_sense_type" title="on.corpora.sense.wn_sense_type"><tt class="xref py py-class docutils literal"><span class="pre">wn_sense_type</span></tt></a> instances</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.sense.on_sense_type.pb_sense_types">
<tt class="descname">pb_sense_types</tt><a class="headerlink" href="#on.corpora.sense.on_sense_type.pb_sense_types" title="Permalink to this definition">¶</a></dt>
<dd><p>list of <a class="reference internal" href="#on.corpora.sense.pb_sense_type" title="on.corpora.sense.pb_sense_type"><tt class="xref py py-class docutils literal"><span class="pre">pb_sense_type</span></tt></a> instances (frame senses)</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.sense.on_sense_type.sense_type">
<tt class="descname">sense_type</tt><a class="headerlink" href="#on.corpora.sense.on_sense_type.sense_type" title="Permalink to this definition">¶</a></dt>
<dd><p>the type of the sense, such as &#8216;Event&#8217;</p>
</dd></dl>

</div></blockquote>
<p>Methods:</p>
<blockquote>
<div><dl class="classmethod">
<dt id="on.corpora.sense.on_sense_type.get_name">
<em class="property">classmethod </em><tt class="descname">get_name</tt><big>(</big><em>a_lemma</em>, <em>a_pos</em>, <em>a_sense</em><big>)</big><a class="headerlink" href="#on.corpora.sense.on_sense_type.get_name" title="Permalink to this definition">¶</a></dt>
<dd><p>given a lemma, pos, and sense number, return the name from the sense inventory</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="on.corpora.sense.on_sense_lemma_type">
<em class="property">class </em><tt class="descclassname">on.corpora.sense.</tt><tt class="descname">on_sense_lemma_type</tt><big>(</big><em>a_on_sense</em><big>)</big><a class="headerlink" href="#on.corpora.sense.on_sense_lemma_type" title="Permalink to this definition">¶</a></dt>
<dd><p>computes and holds ita statistics for a lemma/pos combination</p>
<p>Inter-annotator-agreement (ita) is tricky for <a class="reference internal" href="#on.corpora.sense.on_sense" title="on.corpora.sense.on_sense"><tt class="xref py py-class docutils literal"><span class="pre">on_sense</span></tt></a>
because we have three annotators.  There&#8217;s &#8216;ann_1&#8217;, &#8216;ann_2&#8217;, and
then sometimes an adjudicator.  Sometimes all sense annotations
were adjudicated, other times only disagreements were.  So it&#8217;s
not obvious what the question &#8216;what is the ita for run-v&#8217; actually
means.  We currently have two statistics, though may compute
others in the future:</p>
<p>Statistics:</p>
<blockquote>
<div><ul class="simple">
<li><tt class="docutils literal"><span class="pre">count</span></tt> &#8211; the number of times we had individual annotator information for this sense</li>
<li><tt class="docutils literal"><span class="pre">ann_1_2_agreement</span></tt> &#8211; the percentage of the time that annotator 1 and annotator 2 agreed on the sense</li>
</ul>
</div></blockquote>
<p>Because adjudication lags behind annotation and we do not include
sense annotations that are unadjudicated disagreements, the
<tt class="docutils literal"><span class="pre">ann_1_2_agreement</span></tt> will be slightly higher than it ought to be
for considering how difficult a lemma is to tag.  Consider the
following sense annotations:</p>
<div class="highlight-bash"><div class="highlight"><pre>... asset-n 2,2 2
... asset-n 1,2 1
... asset-n 3,3 3
... asset-n 1,2
... asset-n 3,3
... asset-n 2,2
... asset-n 3,1
</pre></div>
</div>
<p>The first three examples have been adjudicated, the final four
have not.  One would expect, then, for <tt class="docutils literal"><span class="pre">count</span></tt> to be 7 and
<tt class="docutils literal"><span class="pre">ann_1_2_agreement</span></tt> 57 percent.  But the two unadjudicated
disagreements will be reserved for adjudication, so we&#8217;re really
computing these statistics on:</p>
<div class="highlight-bash"><div class="highlight"><pre>... asset-n 2,2 2
... asset-n 1,2 1
... asset-n 3,3 3
... asset-n 3,3
... asset-n 2,2
</pre></div>
</div>
<p>This decreases <tt class="docutils literal"><span class="pre">count</span></tt> to 5 while keeping the number of times
ann_1 and ann_2 agreed at 4, raising <tt class="docutils literal"><span class="pre">ann_1_2_agreement</span></tt> to 80
percent.  This is a true measure of the ITA (or quality) of the
released data, but a misleading measure of the difficulty of
annotation on this lemma.  As we will eventually adjudicate all
unadjudicated disagreements this is not a permanent issue, but it
is something to be aware of for now.</p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.sense.sense_inventory">
<em class="property">class </em><tt class="descclassname">on.corpora.sense.</tt><tt class="descname">sense_inventory</tt><big>(</big><em>a_fname</em>, <em>a_xml_string</em>, <em>a_lang_id</em>, <em>a_frame_set_hash={}</em><big>)</big><a class="headerlink" href="#on.corpora.sense.sense_inventory" title="Permalink to this definition">¶</a></dt>
<dd><p>Contains: <a class="reference internal" href="#on.corpora.sense.on_sense_type" title="on.corpora.sense.on_sense_type"><tt class="xref py py-class docutils literal"><span class="pre">on_sense_type</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.sense.pb_sense_type">
<em class="property">class </em><tt class="descclassname">on.corpora.sense.</tt><tt class="descname">pb_sense_type</tt><big>(</big><em>lemma</em>, <em>num</em><big>)</big><a class="headerlink" href="#on.corpora.sense.pb_sense_type" title="Permalink to this definition">¶</a></dt>
<dd><p>A frame sense</p>
<p>Contained by: <a class="reference internal" href="#on.corpora.proposition.frame_set" title="on.corpora.proposition.frame_set"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.proposition.frame_set</span></tt></a>, <a class="reference internal" href="#on.corpora.sense.on_sense_type" title="on.corpora.sense.on_sense_type"><tt class="xref py py-class docutils literal"><span class="pre">on_sense_type</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.sense.wn_sense_type">
<em class="property">class </em><tt class="descclassname">on.corpora.sense.</tt><tt class="descname">wn_sense_type</tt><big>(</big><em>lemma</em>, <em>wn_sense_num</em>, <em>pos</em>, <em>wn_version</em><big>)</big><a class="headerlink" href="#on.corpora.sense.wn_sense_type" title="Permalink to this definition">¶</a></dt>
<dd><p>a wordnet sense, for mapping ontonotes senses to wordnet senses</p>
<p>Contained by: <a class="reference internal" href="#on.corpora.sense.on_sense_type" title="on.corpora.sense.on_sense_type"><tt class="xref py py-class docutils literal"><span class="pre">on_sense_type</span></tt></a></p>
</dd></dl>

</div>
<span class="target" id="module-on.corpora.coreference"></span><div class="section" id="coreference-coreferential-entity-annotation">
<h2><tt class="xref py py-mod docutils literal"><span class="pre">coreference</span></tt> &#8211; Coreferential Entity Annotation<a class="headerlink" href="#coreference-coreferential-entity-annotation" title="Permalink to this headline">¶</a></h2>
<p>See:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.coreference.coreference_link" title="on.corpora.coreference.coreference_link"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.coreference.coreference_link</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.coreference.coreference_bank" title="on.corpora.coreference.coreference_bank"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.coreference.coreference_bank</span></tt></a></li>
</ul>
</div></blockquote>
<p>Coreference annotation consists of indicating which mentions in a
text refer to the same entity.  The <tt class="docutils literal"><span class="pre">.coref</span></tt> file format looks
like this:</p>
<p>Correspondences:</p>
<blockquote>
<div><table border="1" class="docutils">
<colgroup>
<col width="19%" />
<col width="33%" />
<col width="48%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head"><strong>Database Tables</strong></th>
<th class="head"><strong>Python Objects</strong></th>
<th class="head"><strong>File Elements</strong></th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">coreference_bank</span></tt></td>
<td><a class="reference internal" href="#on.corpora.coreference.coreference_bank" title="on.corpora.coreference.coreference_bank"><tt class="xref py py-class docutils literal"><span class="pre">coreference_bank</span></tt></a></td>
<td>All <tt class="docutils literal"><span class="pre">.coref</span></tt> files in an <a class="reference internal" href="#on.corpora.subcorpus" title="on.corpora.subcorpus"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.subcorpus</span></tt></a></td>
</tr>
<tr class="row-odd"><td>None</td>
<td><a class="reference internal" href="#on.corpora.coreference.coreference_document" title="on.corpora.coreference.coreference_document"><tt class="xref py py-class docutils literal"><span class="pre">coreference_document</span></tt></a></td>
<td>A <tt class="docutils literal"><span class="pre">.coref</span></tt> file (a <tt class="docutils literal"><span class="pre">DOC</span></tt> span)</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">tree.coreference_section</span></tt></td>
<td><a class="reference internal" href="#on.corpora.tree.tree.coref_section" title="on.corpora.tree.tree.coref_section"><tt class="xref py py-attr docutils literal"><span class="pre">on.corpora.tree.tree.coref_section</span></tt></a></td>
<td>An annotation section of a <tt class="docutils literal"><span class="pre">.coref</span></tt> file (a <tt class="docutils literal"><span class="pre">TEXT</span></tt> span)</td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">tree</span></tt></td>
<td><a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a></td>
<td>A line in a <tt class="docutils literal"><span class="pre">.coref</span></tt> file</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">coreference_chain</span></tt></td>
<td><a class="reference internal" href="#on.corpora.coreference.coreference_chain" title="on.corpora.coreference.coreference_chain"><tt class="xref py py-class docutils literal"><span class="pre">coreference_chain</span></tt></a></td>
<td>All <tt class="docutils literal"><span class="pre">COREF</span></tt> spans with a given <tt class="docutils literal"><span class="pre">ID</span></tt></td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">coreference_chain.type</span></tt></td>
<td><a class="reference internal" href="#on.corpora.coreference.coreference_chain.type" title="on.corpora.coreference.coreference_chain.type"><tt class="xref py py-attr docutils literal"><span class="pre">coreference_chain.type</span></tt></a></td>
<td>The <tt class="docutils literal"><span class="pre">TYPE</span></tt> field of a coreference link (the same for all links in a chain)</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">coreference_chain.speaker</span></tt></td>
<td><a class="reference internal" href="#on.corpora.coreference.coreference_chain.speaker" title="on.corpora.coreference.coreference_chain.speaker"><tt class="xref py py-attr docutils literal"><span class="pre">coreference_chain.speaker</span></tt></a></td>
<td>The <tt class="docutils literal"><span class="pre">TYPE</span></tt> field of a coreference chain (the same for all links in a chain)</td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">coreference_link</span></tt></td>
<td><a class="reference internal" href="#on.corpora.coreference.coreference_link" title="on.corpora.coreference.coreference_link"><tt class="xref py py-class docutils literal"><span class="pre">coreference_link</span></tt></a></td>
<td>A single <tt class="docutils literal"><span class="pre">COREF</span></tt> span</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">coreference_link.type</span></tt></td>
<td><a class="reference internal" href="#on.corpora.coreference.coreference_link.type" title="on.corpora.coreference.coreference_link.type"><tt class="xref py py-attr docutils literal"><span class="pre">coreference_link.type</span></tt></a></td>
<td>The <tt class="docutils literal"><span class="pre">SUBTYPE</span></tt> field of a coreference link</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>Note that coreference section information is stored very differently
the files than in the database and python objects.  For more details
see the <a class="reference internal" href="#on.corpora.tree.tree.coref_section" title="on.corpora.tree.tree.coref_section"><tt class="xref py py-attr docutils literal"><span class="pre">on.corpora.tree.tree.coref_section</span></tt></a> documentation</p>
<p>Classes:</p>
<dl class="class">
<dt id="on.corpora.coreference.coreference_bank">
<em class="property">class </em><tt class="descclassname">on.corpora.coreference.</tt><tt class="descname">coreference_bank</tt><big>(</big><em>a_subcorpus</em>, <em>tag</em>, <em>a_cursor=None</em>, <em>extension='coref'</em>, <em>indexing='token'</em><big>)</big><a class="headerlink" href="#on.corpora.coreference.coreference_bank" title="Permalink to this definition">¶</a></dt>
<dd><p>Contains: <a class="reference internal" href="#on.corpora.coreference.coreference_document" title="on.corpora.coreference.coreference_document"><tt class="xref py py-class docutils literal"><span class="pre">coreference_document</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.coreference.coreference_document">
<em class="property">class </em><tt class="descclassname">on.corpora.coreference.</tt><tt class="descname">coreference_document</tt><big>(</big><em>enc_doc_string</em>, <em>document_id</em>, <em>extension='coref'</em>, <em>indexing='token'</em>, <em>a_cursor=None</em>, <em>adjudicated=True</em><big>)</big><a class="headerlink" href="#on.corpora.coreference.coreference_document" title="Permalink to this definition">¶</a></dt>
<dd><p>Contained by: <a class="reference internal" href="#on.corpora.coreference.coreference_bank" title="on.corpora.coreference.coreference_bank"><tt class="xref py py-class docutils literal"><span class="pre">coreference_bank</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.coreference.coreference_chain" title="on.corpora.coreference.coreference_chain"><tt class="xref py py-class docutils literal"><span class="pre">coreference_chain</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.coreference.coreference_chain">
<em class="property">class </em><tt class="descclassname">on.corpora.coreference.</tt><tt class="descname">coreference_chain</tt><big>(</big><em>type</em>, <em>identifier</em>, <em>section</em>, <em>document_id</em>, <em>a_cursor=None</em>, <em>speaker=''</em><big>)</big><a class="headerlink" href="#on.corpora.coreference.coreference_chain" title="Permalink to this definition">¶</a></dt>
<dd><p>Contained by: <a class="reference internal" href="#on.corpora.coreference.coreference_document" title="on.corpora.coreference.coreference_document"><tt class="xref py py-class docutils literal"><span class="pre">coreference_document</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.coreference.coreference_link" title="on.corpora.coreference.coreference_link"><tt class="xref py py-class docutils literal"><span class="pre">coreference_link</span></tt></a></p>
<p>Attributes:</p>
<blockquote>
<div><dl class="attribute">
<dt id="on.corpora.coreference.coreference_chain.identifier">
<tt class="descname">identifier</tt><a class="headerlink" href="#on.corpora.coreference.coreference_chain.identifier" title="Permalink to this definition">¶</a></dt>
<dd><p>Which coref chain this is.  This value is unique to this
document, though not across documents.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_chain.type">
<tt class="descname">type</tt><a class="headerlink" href="#on.corpora.coreference.coreference_chain.type" title="Permalink to this definition">¶</a></dt>
<dd><p>Whether we represent an <tt class="docutils literal"><span class="pre">APPOS</span></tt> reference or an <tt class="docutils literal"><span class="pre">IDENT</span></tt> one.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_chain.section">
<tt class="descname">section</tt><a class="headerlink" href="#on.corpora.coreference.coreference_chain.section" title="Permalink to this definition">¶</a></dt>
<dd><p>Which section of the coreference document we belong in.  See
<a class="reference internal" href="#on.corpora.tree.tree.coref_section" title="on.corpora.tree.tree.coref_section"><tt class="xref py py-attr docutils literal"><span class="pre">on.corpora.tree.tree.coref_section</span></tt></a> for more details.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_chain.document_id">
<tt class="descname">document_id</tt><a class="headerlink" href="#on.corpora.coreference.coreference_chain.document_id" title="Permalink to this definition">¶</a></dt>
<dd><p>The id of the document that we belong to</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_chain.coreference_links">
<tt class="descname">coreference_links</tt><a class="headerlink" href="#on.corpora.coreference.coreference_chain.coreference_links" title="Permalink to this definition">¶</a></dt>
<dd><p>A list of <a class="reference internal" href="#on.corpora.coreference.coreference_link" title="on.corpora.coreference.coreference_link"><tt class="xref py py-class docutils literal"><span class="pre">coreference_link</span></tt></a> instances.  Better to use
<tt class="docutils literal"><span class="pre">[]</span></tt> or iteration on the chain than to use this list
directly, though.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_chain.speaker">
<tt class="descname">speaker</tt><a class="headerlink" href="#on.corpora.coreference.coreference_chain.speaker" title="Permalink to this definition">¶</a></dt>
<dd><p>A string or the empty string.  For coref chains that are
coreferent with one of the speakers in the document, this
will be set to the speaker&#8217;s name.  To see which speakers are
responsible for which sentences, either use the <tt class="docutils literal"><span class="pre">.speaker</span></tt>
file or look at the <tt class="xref py py-attr docutils literal"><span class="pre">on.corpora.tree.speaker_sentence</span></tt>
attribute of trees.  During the coreference annotation
process the human annotators had access to the name of the
speaker for each line.</p>
<p>Note that the speaker attribute does not represent the person
who spoke this sentence.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="on.corpora.coreference.coreference_link">
<em class="property">class </em><tt class="descclassname">on.corpora.coreference.</tt><tt class="descname">coreference_link</tt><big>(</big><em>type</em>, <em>coreference_chain</em>, <em>a_cursor=None</em>, <em>start_char_offset=0</em>, <em>end_char_offset=0</em>, <em>precise=False</em><big>)</big><a class="headerlink" href="#on.corpora.coreference.coreference_link" title="Permalink to this definition">¶</a></dt>
<dd><p>A coreference annotation</p>
<p>Contained by: <a class="reference internal" href="#on.corpora.coreference.coreference_chain" title="on.corpora.coreference.coreference_chain"><tt class="xref py py-class docutils literal"><span class="pre">coreference_chain</span></tt></a></p>
<p>Attributes:</p>
<blockquote>
<div><dl class="attribute">
<dt id="on.corpora.coreference.coreference_link.string">
<tt class="descname">string</tt><a class="headerlink" href="#on.corpora.coreference.coreference_link.string" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_link.start_token_index">
<tt class="descname">start_token_index</tt><a class="headerlink" href="#on.corpora.coreference.coreference_link.start_token_index" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_link.end_token_index">
<tt class="descname">end_token_index</tt><a class="headerlink" href="#on.corpora.coreference.coreference_link.end_token_index" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_link.start_word_index">
<tt class="descname">start_word_index</tt><a class="headerlink" href="#on.corpora.coreference.coreference_link.start_word_index" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_link.end_word_index">
<tt class="descname">end_word_index</tt><a class="headerlink" href="#on.corpora.coreference.coreference_link.end_word_index" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_link.sentence_index">
<tt class="descname">sentence_index</tt><a class="headerlink" href="#on.corpora.coreference.coreference_link.sentence_index" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_link.start_leaf">
<tt class="descname">start_leaf</tt><a class="headerlink" href="#on.corpora.coreference.coreference_link.start_leaf" title="Permalink to this definition">¶</a></dt>
<dd><p>An <a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a> instance.  None until enrichment</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_link.end_leaf">
<tt class="descname">end_leaf</tt><a class="headerlink" href="#on.corpora.coreference.coreference_link.end_leaf" title="Permalink to this definition">¶</a></dt>
<dd><p>An <a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a> instance.  None until enrichment</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_link.subtree">
<tt class="descname">subtree</tt><a class="headerlink" href="#on.corpora.coreference.coreference_link.subtree" title="Permalink to this definition">¶</a></dt>
<dd><p>An <a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a> instance.  None until
enrichment.  After enrichment, if we could not align this
span with any node in the tree, it remains None.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_link.subtree_id">
<tt class="descname">subtree_id</tt><a class="headerlink" href="#on.corpora.coreference.coreference_link.subtree_id" title="Permalink to this definition">¶</a></dt>
<dd><p>After enrichment, evaluates to <a class="reference internal" href="#on.corpora.coreference.coreference_link.subtree" title="on.corpora.coreference.coreference_link.subtree"><tt class="xref py py-attr docutils literal"><span class="pre">subtree</span></tt></a> <tt class="docutils literal"><span class="pre">.id</span></tt>.
This value is written to the database, and so is available
before enrichment when one is loading from the database.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_link.type">
<tt class="descname">type</tt><a class="headerlink" href="#on.corpora.coreference.coreference_link.type" title="Permalink to this definition">¶</a></dt>
<dd><p>All coreference chains with type <tt class="docutils literal"><span class="pre">IDENT</span></tt> have coreference
links with type <tt class="docutils literal"><span class="pre">IDENT</span></tt>.  If the coreference chain has
type <tt class="docutils literal"><span class="pre">APPOS</span></tt> (appositive) then one coreference link will
be the <tt class="docutils literal"><span class="pre">HEAD</span></tt> while the other links will be <tt class="docutils literal"><span class="pre">ATTRIB</span></tt>.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_link.coreference_chain">
<tt class="descname">coreference_chain</tt><a class="headerlink" href="#on.corpora.coreference.coreference_link.coreference_chain" title="Permalink to this definition">¶</a></dt>
<dd><p>What <a class="reference internal" href="#on.corpora.coreference.coreference_chain" title="on.corpora.coreference.coreference_chain"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.coreference.coreference_chain</span></tt></a>
contains this link.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_link.start_char_offset">
<tt class="descname">start_char_offset</tt><a class="headerlink" href="#on.corpora.coreference.coreference_link.start_char_offset" title="Permalink to this definition">¶</a></dt>
<dd><p>In the case of a token like &#8216;Japan-China&#8217; we want to be
able to tag &#8216;Japan&#8217; and &#8216;China&#8217; separately.  We do this by
specifying a character offset from the beginning and end to
describe how much of the token span we care about.  So in
this case to tag only &#8216;China&#8217; we would set
start_char_offset to 6.  To tag only &#8216;Japan&#8217; we would set
end_char_offset to &#8216;6&#8217;.  If these offsets are 0, then, we
use whole tokens.</p>
<p>These correspond to the &#8216;S_OFF&#8217; and &#8216;E_OFF&#8217; attributes in
the coref files.</p>
<p>For the most complex cases, something like &#8216;Hong
Kong-Zhuhai-Macau&#8217;, we specify both the start and the end
offsets.  The coref structure looks like:</p>
<div class="highlight-python"><pre>&lt;COREF&gt;Hong &lt;COREF&gt;&lt;COREF&gt;Kong-Zhuhai-Macau&lt;/COREF&gt;&lt;/COREF&gt;&lt;/COREF&gt;</pre>
</div>
<p>And the offsets are E_OFF=13 for Hong Kong, S_OFF=5 and
E_OFF=6 for &#8216;Zhuhai&#8217;, and S_OFF=12 for &#8216;Macau&#8217;</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.coreference.coreference_link.end_char_offset">
<tt class="descname">end_char_offset</tt><a class="headerlink" href="#on.corpora.coreference.coreference_link.end_char_offset" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#on.corpora.coreference.coreference_link.start_char_offset" title="on.corpora.coreference.coreference_link.start_char_offset"><tt class="xref py py-attr docutils literal"><span class="pre">coreference_link.start_char_offset</span></tt></a></p>
</dd></dl>

</div></blockquote>
<p>Before enrichment, generally either the token indices or the word
indices will be set but not both.  After enrichment, both sets of
indices will work and will delegate their responses to start_leaf
or end_leaf as appropriate.</p>
</dd></dl>

</div>
<span class="target" id="module-on.corpora.name"></span><div class="section" id="name-name-entity-annotation">
<h2><tt class="xref py py-mod docutils literal"><span class="pre">name</span></tt> &#8211; Name-Entity Annotation<a class="headerlink" href="#name-name-entity-annotation" title="Permalink to this headline">¶</a></h2>
<p>See:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.name.name_entity" title="on.corpora.name.name_entity"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.name.name_entity</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.name.name_bank" title="on.corpora.name.name_bank"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.name.name_bank</span></tt></a></li>
</ul>
</div></blockquote>
<p>Correspondences:</p>
<blockquote>
<div><table border="1" class="docutils">
<colgroup>
<col width="19%" />
<col width="34%" />
<col width="47%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><strong>Database Tables</strong></td>
<td><strong>Python Objects</strong></td>
<td><strong>File Elements</strong></td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">name_bank</span></tt></td>
<td><a class="reference internal" href="#on.corpora.name.name_bank" title="on.corpora.name.name_bank"><tt class="xref py py-class docutils literal"><span class="pre">name_bank</span></tt></a></td>
<td>All <tt class="docutils literal"><span class="pre">.name</span></tt> files in an <a class="reference internal" href="#on.corpora.subcorpus" title="on.corpora.subcorpus"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.subcorpus</span></tt></a></td>
</tr>
<tr class="row-odd"><td>None</td>
<td><a class="reference internal" href="#on.corpora.name.name_tagged_document" title="on.corpora.name.name_tagged_document"><tt class="xref py py-class docutils literal"><span class="pre">name_tagged_document</span></tt></a></td>
<td>A <tt class="docutils literal"><span class="pre">.name</span></tt> file</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">tree</span></tt></td>
<td><a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a></td>
<td>A line in a <tt class="docutils literal"><span class="pre">.name</span></tt> file</td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">name_entity</span></tt></td>
<td><a class="reference internal" href="#on.corpora.name.name_entity" title="on.corpora.name.name_entity"><tt class="xref py py-class docutils literal"><span class="pre">name_entity</span></tt></a></td>
<td>A single <tt class="docutils literal"><span class="pre">ENAMEX</span></tt>, <tt class="docutils literal"><span class="pre">TIMEX</span></tt>, or <tt class="docutils literal"><span class="pre">NUMEX</span></tt> span</td>
</tr>
<tr class="row-even"><td>None</td>
<td><a class="reference internal" href="#on.corpora.name.name_entity_set" title="on.corpora.name.name_entity_set"><tt class="xref py py-class docutils literal"><span class="pre">name_entity_set</span></tt></a></td>
<td>All <a class="reference internal" href="#on.corpora.name.name_entity" title="on.corpora.name.name_entity"><tt class="xref py py-class docutils literal"><span class="pre">name_entity</span></tt></a> instances for one <a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a></td>
</tr>
</tbody>
</table>
</div></blockquote>
<dl class="class">
<dt id="on.corpora.name.name_bank">
<em class="property">class </em><tt class="descclassname">on.corpora.name.</tt><tt class="descname">name_bank</tt><big>(</big><em>a_subcorpus</em>, <em>tag</em>, <em>a_cursor=None</em>, <em>extension='name'</em>, <em>indexing='word'</em><big>)</big><a class="headerlink" href="#on.corpora.name.name_bank" title="Permalink to this definition">¶</a></dt>
<dd><p>Contains <a class="reference internal" href="#on.corpora.name.name_tagged_document" title="on.corpora.name.name_tagged_document"><tt class="xref py py-class docutils literal"><span class="pre">name_tagged_document</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.name.name_tagged_document">
<em class="property">class </em><tt class="descclassname">on.corpora.name.</tt><tt class="descname">name_tagged_document</tt><big>(</big><em>document_string</em>, <em>document_id</em>, <em>extension='name'</em>, <em>indexing='word'</em>, <em>a_cursor=None</em><big>)</big><a class="headerlink" href="#on.corpora.name.name_tagged_document" title="Permalink to this definition">¶</a></dt>
<dd><p>Contained by: <a class="reference internal" href="#on.corpora.name.name_bank" title="on.corpora.name.name_bank"><tt class="xref py py-class docutils literal"><span class="pre">name_bank</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.name.name_entity_set" title="on.corpora.name.name_entity_set"><tt class="xref py py-class docutils literal"><span class="pre">name_entity_set</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.name.name_entity">
<em class="property">class </em><tt class="descclassname">on.corpora.name.</tt><tt class="descname">name_entity</tt><big>(</big><em>sentence_index</em>, <em>document_id</em>, <em>type</em>, <em>start_index</em>, <em>end_index</em>, <em>string</em>, <em>indexing='word'</em>, <em>start_char_offset=0</em>, <em>end_char_offset=0</em><big>)</big><a class="headerlink" href="#on.corpora.name.name_entity" title="Permalink to this definition">¶</a></dt>
<dd><p>A name annotation</p>
<p>Contained by: <a class="reference internal" href="#on.corpora.name.name_entity_set" title="on.corpora.name.name_entity_set"><tt class="xref py py-class docutils literal"><span class="pre">name_entity_set</span></tt></a></p>
<p>Attributes:</p>
<blockquote>
<div><dl class="attribute">
<dt id="on.corpora.name.name_entity.string">
<tt class="descname">string</tt><a class="headerlink" href="#on.corpora.name.name_entity.string" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.name.name_entity.start_token_index">
<tt class="descname">start_token_index</tt><a class="headerlink" href="#on.corpora.name.name_entity.start_token_index" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.name.name_entity.end_token_index">
<tt class="descname">end_token_index</tt><a class="headerlink" href="#on.corpora.name.name_entity.end_token_index" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.name.name_entity.start_word_index">
<tt class="descname">start_word_index</tt><a class="headerlink" href="#on.corpora.name.name_entity.start_word_index" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.name.name_entity.end_word_index">
<tt class="descname">end_word_index</tt><a class="headerlink" href="#on.corpora.name.name_entity.end_word_index" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.name.name_entity.sentence_index">
<tt class="descname">sentence_index</tt><a class="headerlink" href="#on.corpora.name.name_entity.sentence_index" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="on.corpora.name.name_entity.start_leaf">
<tt class="descname">start_leaf</tt><a class="headerlink" href="#on.corpora.name.name_entity.start_leaf" title="Permalink to this definition">¶</a></dt>
<dd><p>An <a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a> instance.  None until enrichment</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.name.name_entity.end_leaf">
<tt class="descname">end_leaf</tt><a class="headerlink" href="#on.corpora.name.name_entity.end_leaf" title="Permalink to this definition">¶</a></dt>
<dd><p>An <a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a> instance.  None until enrichment</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.name.name_entity.subtree">
<tt class="descname">subtree</tt><a class="headerlink" href="#on.corpora.name.name_entity.subtree" title="Permalink to this definition">¶</a></dt>
<dd><p>An <a class="reference internal" href="#on.corpora.tree.tree" title="on.corpora.tree.tree"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.tree.tree</span></tt></a> instance.  None until
unrichment.  After enrichment, if we could not align this
span with any node in the tree, it remains None.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.name.name_entity.subtree_id">
<tt class="descname">subtree_id</tt><a class="headerlink" href="#on.corpora.name.name_entity.subtree_id" title="Permalink to this definition">¶</a></dt>
<dd><p>After enrichment, evaluates to <a class="reference internal" href="#on.corpora.name.name_entity.subtree" title="on.corpora.name.name_entity.subtree"><tt class="xref py py-attr docutils literal"><span class="pre">subtree</span></tt></a> <tt class="docutils literal"><span class="pre">.id</span></tt>.
This value is written to the database, and so is available
before enrichment when one is loading from the database.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.name.name_entity.type">
<tt class="descname">type</tt><a class="headerlink" href="#on.corpora.name.name_entity.type" title="Permalink to this definition">¶</a></dt>
<dd><p>The type of this named entity, such as <tt class="docutils literal"><span class="pre">PERSON</span></tt> or
<tt class="docutils literal"><span class="pre">NORP</span></tt>.</p>
</dd></dl>

</div></blockquote>
<p>Before enrichment, generally either the token indecies or the word
indecies will be set but not both.  After enrichment, both sets of
indecies will work and will delegate their responses to
<a class="reference internal" href="#on.corpora.name.name_entity.start_leaf" title="on.corpora.name.name_entity.start_leaf"><tt class="xref py py-attr docutils literal"><span class="pre">start_leaf</span></tt></a> or <a class="reference internal" href="#on.corpora.name.name_entity.end_leaf" title="on.corpora.name.name_entity.end_leaf"><tt class="xref py py-attr docutils literal"><span class="pre">end_leaf</span></tt></a> as appropriate.</p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.name.name_entity_set">
<em class="property">class </em><tt class="descclassname">on.corpora.name.</tt><tt class="descname">name_entity_set</tt><big>(</big><em>a_document_id</em><big>)</big><a class="headerlink" href="#on.corpora.name.name_entity_set" title="Permalink to this definition">¶</a></dt>
<dd><p>all the name entities for a single sentence</p>
<p>Contained by: <a class="reference internal" href="#on.corpora.name.name_tagged_document" title="on.corpora.name.name_tagged_document"><tt class="xref py py-class docutils literal"><span class="pre">name_tagged_document</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.name.name_entity" title="on.corpora.name.name_entity"><tt class="xref py py-class docutils literal"><span class="pre">name_entity</span></tt></a></p>
</dd></dl>

</div>
<span class="target" id="module-on.corpora.ontology"></span><div class="section" id="ontology-ontology-annotation">
<h2><tt class="xref py py-mod docutils literal"><span class="pre">ontology</span></tt> &#8211; Ontology Annotation<a class="headerlink" href="#ontology-ontology-annotation" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="on.corpora.ontology.ontology">
<em class="property">class </em><tt class="descclassname">on.corpora.ontology.</tt><tt class="descname">ontology</tt><big>(</big><em>a_id</em>, <em>a_upper_model</em>, <em>a_sense_pool_collection</em>, <em>a_cursor=None</em><big>)</big><a class="headerlink" href="#on.corpora.ontology.ontology" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="class">
<dt id="on.corpora.ontology.upper_model">
<em class="property">class </em><tt class="descclassname">on.corpora.ontology.</tt><tt class="descname">upper_model</tt><big>(</big><em>a_id</em>, <em>a_um_string</em>, <em>a_cursor=None</em><big>)</big><a class="headerlink" href="#on.corpora.ontology.upper_model" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="class">
<dt id="on.corpora.ontology.sense_pool">
<em class="property">class </em><tt class="descclassname">on.corpora.ontology.</tt><tt class="descname">sense_pool</tt><big>(</big><em>a_sense_pool_id</em>, <em>a_sense_pool_string</em>, <em>a_cursor=None</em><big>)</big><a class="headerlink" href="#on.corpora.ontology.sense_pool" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="class">
<dt id="on.corpora.ontology.sense_pool_collection">
<em class="property">class </em><tt class="descclassname">on.corpora.ontology.</tt><tt class="descname">sense_pool_collection</tt><big>(</big><em>a_id</em>, <em>root_dir</em>, <em>a_cursor=None</em><big>)</big><a class="headerlink" href="#on.corpora.ontology.sense_pool_collection" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="class">
<dt id="on.corpora.ontology.concept">
<em class="property">class </em><tt class="descclassname">on.corpora.ontology.</tt><tt class="descname">concept</tt><big>(</big><em>a_concept_string</em>, <em>a_cursor=None</em><big>)</big><a class="headerlink" href="#on.corpora.ontology.concept" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="class">
<dt id="on.corpora.ontology.feature">
<em class="property">class </em><tt class="descclassname">on.corpora.ontology.</tt><tt class="descname">feature</tt><big>(</big><em>a_feature</em><big>)</big><a class="headerlink" href="#on.corpora.ontology.feature" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="exception">
<dt id="on.corpora.ontology.no_such_parent_concept_error">
<em class="property">exception </em><tt class="descclassname">on.corpora.ontology.</tt><tt class="descname">no_such_parent_concept_error</tt><a class="headerlink" href="#on.corpora.ontology.no_such_parent_concept_error" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="exception">
<dt id="on.corpora.ontology.no_such_parent_sense_pool_error">
<em class="property">exception </em><tt class="descclassname">on.corpora.ontology.</tt><tt class="descname">no_such_parent_sense_pool_error</tt><a class="headerlink" href="#on.corpora.ontology.no_such_parent_sense_pool_error" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<span class="target" id="module-on.corpora.speaker"></span><div class="section" id="speaker-speaker-metadata-for-broadcast-conversation-documents">
<h2><tt class="xref py py-mod docutils literal"><span class="pre">speaker</span></tt> &#8211; Speaker Metadata for Broadcast Conversation Documents<a class="headerlink" href="#speaker-speaker-metadata-for-broadcast-conversation-documents" title="Permalink to this headline">¶</a></h2>
<p>See:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.speaker.speaker_sentence" title="on.corpora.speaker.speaker_sentence"><tt class="xref py py-class docutils literal"><span class="pre">speaker_sentence</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.speaker.speaker_bank" title="on.corpora.speaker.speaker_bank"><tt class="xref py py-class docutils literal"><span class="pre">speaker_bank</span></tt></a></li>
</ul>
</div></blockquote>
<p>Speaker metadata is additional information collected at the sentence
level about speakers before annotation.  The data is stored in
<tt class="docutils literal"><span class="pre">.speaker</span></tt> files:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>head data/english/annotations/bc/cnn/00/cnn_0000.speaker
0.0584225900682 12.399083739    speaker1        male    native
0.0584225900682 12.399083739    speaker1        male    native
0.0584225900682 12.399083739    speaker1        male    native
0.0584225900682 12.399083739    speaker1        male    native
0.0584225900682 12.399083739    speaker1        male    native
12.3271665044   21.6321665044   paula_zahn      female  native
12.3271665044   21.6321665044   paula_zahn      female  native
12.3271665044   21.6321665044   paula_zahn      female  native
12.3271665044   21.6321665044   paula_zahn      female  native
12.3271665044   27.7053583252   paula_zahn      female  native
</pre></div>
</div>
<p>There is one <tt class="docutils literal"><span class="pre">.speaker</span></tt> line for each tree in the document, so above
is the speaker metadata for the first 10 trees in cnn_0000.  The
columns are <tt class="docutils literal"><span class="pre">start_time</span></tt>, <tt class="docutils literal"><span class="pre">stop_time</span></tt>, <tt class="docutils literal"><span class="pre">name</span></tt>, <tt class="docutils literal"><span class="pre">gender</span></tt>, and
<tt class="docutils literal"><span class="pre">competency</span></tt>.  These values are available in attributes of
<a class="reference internal" href="#on.corpora.speaker.speaker_sentence" title="on.corpora.speaker.speaker_sentence"><tt class="xref py py-class docutils literal"><span class="pre">speaker_sentence</span></tt></a> with those names.</p>
<p>You might notice that the start and stop times don&#8217;t make sense.  How
can speaker1 say five things where each begins at time 0.05 and ends
at time 12.4?  When speakers said a group of parsable statements in
quick succession, start and stop times were usually only recorded for
the group.  I&#8217;m going to refer to these groups as &#8216;annotation
groups&#8217;.  An annotation group is roughly analogous to a sentence (by
which I mean a single tree); it represents a sequence of words that
the annotator doing the transcription grouped together.</p>
<p>Another place this is confusing is with paula_zahn&#8217;s final sentence.
It has the same start time as her previous four sentences, but a
different end time.  This is because that tree contains words from two
different annotation groups.  When this happens, the <tt class="docutils literal"><span class="pre">.speaker</span></tt> line
will use the start_time of the initial group and the end_time of the
final group.  When this happens with the other columns (speakers
completing each other&#8217;s sentences) we list all values separated by
commas, but this is rare.  One example would be tree 41 in english bc
msnbc document 0006 where George Bush completes one of Andrea
Mitchel&#8217;s sentences.  With &#8216;CODE&#8217; statements added to make it clear
where the breaks between speakers go, the tree looks like:</p>
<div class="highlight-scheme"><div class="highlight"><pre><span class="p">(</span> <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">CODE</span> <span class="nv">&lt;176</span><span class="o">.</span><span class="mi">038501264</span><span class="nv">:182</span><span class="o">.</span><span class="mi">072501264</span><span class="nv">:Andrea_Mitchel:42&gt;</span><span class="p">)</span>
      <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NNS</span> <span class="nv">Insights</span><span class="p">)</span> <span class="p">(</span><span class="nf">CC</span> <span class="nv">and</span><span class="p">)</span> <span class="p">(</span><span class="nf">NN</span> <span class="nv">analysis</span><span class="p">))</span>
      <span class="p">(</span><span class="nf">PP</span> <span class="p">(</span><span class="nf">IN</span> <span class="nv">from</span><span class="p">)</span>
          <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Bill</span><span class="p">)</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Bennett</span><span class="p">))</span>
                  <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NN</span> <span class="nv">radio</span><span class="p">)</span> <span class="p">(</span><span class="nf">NN</span> <span class="nv">host</span><span class="p">))</span>
                      <span class="p">(</span><span class="nf">CC</span> <span class="nv">and</span><span class="p">)</span>
                      <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NN</span> <span class="nv">author</span><span class="p">))</span>
                          <span class="p">(</span><span class="nf">PP</span> <span class="p">(</span><span class="nf">IN</span> <span class="nv">of</span><span class="p">)</span>
                              <span class="p">(</span><span class="nf">NP-TTL</span> <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">America</span><span class="p">))</span>
                                      <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">DT</span> <span class="nv">The</span><span class="p">)</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Last</span><span class="p">)</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Best</span><span class="p">)</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Hope</span><span class="p">)))))))</span>
              <span class="p">(</span><span class="nf">CODE</span> <span class="nv">&lt;182</span><span class="o">.</span><span class="mi">072501264</span><span class="nv">:185</span><span class="o">.</span><span class="mi">713501264</span><span class="nv">:Andrea_Mitchel:43&gt;</span><span class="p">)</span>
              <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">John</span><span class="p">)</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Harwood</span><span class="p">))</span>
                  <span class="p">(</span><span class="nf">PP</span> <span class="p">(</span><span class="nf">IN</span> <span class="nv">of</span><span class="p">)</span>
                      <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">DT</span> <span class="nv">The</span><span class="p">)</span>
                              <span class="p">(</span><span class="nf">NML</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Wall</span><span class="p">)</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Street</span><span class="p">))</span>
                              <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Journal</span><span class="p">))</span>
                          <span class="p">(</span><span class="nf">CC</span> <span class="nv">and</span><span class="p">)</span>
                          <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">CNBC</span><span class="p">)))))</span>
              <span class="p">(</span><span class="nf">CODE</span> <span class="nv">&lt;185</span><span class="o">.</span><span class="mi">713501264</span><span class="nv">:188</span><span class="o">.</span><span class="mi">098501264</span><span class="nv">:Andrea_Mitchel:44&gt;</span><span class="p">)</span>
              <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Dana</span><span class="p">)</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Priest</span><span class="p">))</span>
                  <span class="p">(</span><span class="nf">PP</span> <span class="p">(</span><span class="nf">IN</span> <span class="nv">of</span><span class="p">)</span>
                      <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">DT</span> <span class="nv">The</span><span class="p">)</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Washington</span><span class="p">)</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Post</span><span class="p">))))</span>
              <span class="p">(</span><span class="nf">CODE</span> <span class="nv">&lt;188</span><span class="o">.</span><span class="mi">098501264</span><span class="nv">:190</span><span class="o">.</span><span class="mi">355501264</span><span class="nv">:George_W_Bush:45&gt;</span><span class="p">)</span>
              <span class="p">(</span><span class="nf">CC</span> <span class="nv">And</span><span class="p">)</span>
              <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">William</span><span class="p">)</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Safire</span><span class="p">))</span>
                  <span class="p">(</span><span class="nf">PP</span> <span class="p">(</span><span class="nf">IN</span> <span class="nv">of</span><span class="p">)</span>
                      <span class="p">(</span><span class="nf">NP</span> <span class="p">(</span><span class="nf">DT</span> <span class="nv">The</span><span class="p">)</span>
                          <span class="p">(</span><span class="nf">NML</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">New</span><span class="p">)</span> <span class="p">(</span><span class="nf">NNP</span> <span class="nv">York</span><span class="p">))</span>
                          <span class="p">(</span><span class="nf">NNP</span> <span class="nv">Times</span><span class="p">))))))</span>
      <span class="p">(</span><span class="o">.</span> <span class="nv">/</span><span class="o">.</span><span class="p">)))</span>
</pre></div>
</div>
<p>This gives a speaker file that looks like:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>cat data/english/annotations/bc/msnbc/00/msnbc_0006.speaker
...
160.816917439   163.569917439   Andrea_Mitchel  female  native
163.569917439   173.243917439   George_W_Bush   male    native
173.243917439   176.038501264   Andrea_Mitchel  female  native
176.038501264   190.355501264   Andrea_Mitchel,Andrea_Mitchel,Andrea_Mitchel,George_W_Bush      female,female,female,male       native
194.102780118   204.535780118   George_W_Bush   male    native
204.535780118   212.240780118   George_W_Bush   male    native
...
</pre></div>
</div>
<p>Note that the information about when in the statement George Bush took
over for Andrea Mitchel is not retained.</p>
<p>This happens 14 times in the english bc data and not at all in the chinese.</p>
<p>Correspondences:</p>
<blockquote>
<div><table border="1" class="docutils">
<colgroup>
<col width="19%" />
<col width="39%" />
<col width="42%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head"><strong>Database Tables</strong></th>
<th class="head"><strong>Python Objects</strong></th>
<th class="head"><strong>File Elements</strong></th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>None</td>
<td><a class="reference internal" href="#on.corpora.speaker.speaker_bank" title="on.corpora.speaker.speaker_bank"><tt class="xref py py-class docutils literal"><span class="pre">speaker_bank</span></tt></a></td>
<td>All <tt class="docutils literal"><span class="pre">.speaker</span></tt> files in an <a class="reference internal" href="#on.corpora.subcorpus" title="on.corpora.subcorpus"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.subcorpus</span></tt></a></td>
</tr>
<tr class="row-odd"><td>None</td>
<td><a class="reference internal" href="#on.corpora.speaker.speaker_document" title="on.corpora.speaker.speaker_document"><tt class="xref py py-class docutils literal"><span class="pre">speaker_document</span></tt></a></td>
<td>A <tt class="docutils literal"><span class="pre">.speaker</span></tt> file</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">speaker_sentence</span></tt></td>
<td><a class="reference internal" href="#on.corpora.speaker.speaker_sentence" title="on.corpora.speaker.speaker_sentence"><tt class="xref py py-class docutils literal"><span class="pre">speaker_sentence</span></tt></a></td>
<td>A line in a <tt class="docutils literal"><span class="pre">.speaker</span></tt> file</td>
</tr>
</tbody>
</table>
</div></blockquote>
<dl class="class">
<dt id="on.corpora.speaker.speaker_bank">
<em class="property">class </em><tt class="descclassname">on.corpora.speaker.</tt><tt class="descname">speaker_bank</tt><big>(</big><em>a_subcorpus</em>, <em>tag</em>, <em>a_cursor=None</em>, <em>extension='speaker'</em><big>)</big><a class="headerlink" href="#on.corpora.speaker.speaker_bank" title="Permalink to this definition">¶</a></dt>
<dd><p>Contains: <a class="reference internal" href="#on.corpora.speaker.speaker_document" title="on.corpora.speaker.speaker_document"><tt class="xref py py-class docutils literal"><span class="pre">speaker_document</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.speaker.speaker_document">
<em class="property">class </em><tt class="descclassname">on.corpora.speaker.</tt><tt class="descname">speaker_document</tt><big>(</big><em>document_id</em>, <em>extension='speaker'</em><big>)</big><a class="headerlink" href="#on.corpora.speaker.speaker_document" title="Permalink to this definition">¶</a></dt>
<dd><p>Contained by: <a class="reference internal" href="#on.corpora.speaker.speaker_bank" title="on.corpora.speaker.speaker_bank"><tt class="xref py py-class docutils literal"><span class="pre">speaker_bank</span></tt></a></p>
<p>Contains: <a class="reference internal" href="#on.corpora.speaker.speaker_document" title="on.corpora.speaker.speaker_document"><tt class="xref py py-class docutils literal"><span class="pre">speaker_document</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="on.corpora.speaker.speaker_sentence">
<em class="property">class </em><tt class="descclassname">on.corpora.speaker.</tt><tt class="descname">speaker_sentence</tt><big>(</big><em>line_number</em>, <em>document_id</em>, <em>start_time</em>, <em>stop_time</em>, <em>name</em>, <em>gender</em>, <em>competence</em><big>)</big><a class="headerlink" href="#on.corpora.speaker.speaker_sentence" title="Permalink to this definition">¶</a></dt>
<dd><p>Contained by: <a class="reference internal" href="#on.corpora.speaker.speaker_document" title="on.corpora.speaker.speaker_document"><tt class="xref py py-class docutils literal"><span class="pre">speaker_document</span></tt></a></p>
<p>Attributes:</p>
<blockquote>
<div><dl class="attribute">
<dt id="on.corpora.speaker.speaker_sentence.start_time">
<tt class="descname">start_time</tt><a class="headerlink" href="#on.corpora.speaker.speaker_sentence.start_time" title="Permalink to this definition">¶</a></dt>
<dd><p>What time this utterance or series of utterances began.  If some
speaker says three things in quick succession, we may have
parsed these as three separate trees but timing information
could have only been recorded for the three as a block.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.speaker.speaker_sentence.stop_time">
<tt class="descname">stop_time</tt><a class="headerlink" href="#on.corpora.speaker.speaker_sentence.stop_time" title="Permalink to this definition">¶</a></dt>
<dd><p>What time this utterance or series of utterances ended.  The
same caveat as with <a class="reference internal" href="#on.corpora.speaker.speaker_sentence.start_time" title="on.corpora.speaker.speaker_sentence.start_time"><tt class="xref py py-attr docutils literal"><span class="pre">start_time</span></tt></a> applies.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.speaker.speaker_sentence.name">
<tt class="descname">name</tt><a class="headerlink" href="#on.corpora.speaker.speaker_sentence.name" title="Permalink to this definition">¶</a></dt>
<dd><p>The name of the speaker.  This might be something like
&#8216;speaker_1&#8217; if the data was not entered.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.speaker.speaker_sentence.gender">
<tt class="descname">gender</tt><a class="headerlink" href="#on.corpora.speaker.speaker_sentence.gender" title="Permalink to this definition">¶</a></dt>
<dd><p>The gender of the speaker.  Generally &#8216;male&#8217; or &#8216;female&#8217;.</p>
</dd></dl>

<dl class="attribute">
<dt id="on.corpora.speaker.speaker_sentence.competence">
<tt class="descname">competence</tt><a class="headerlink" href="#on.corpora.speaker.speaker_sentence.competence" title="Permalink to this definition">¶</a></dt>
<dd><p>The competency of the speaker in the language.  Generally &#8216;native&#8217;.</p>
</dd></dl>

</div></blockquote>
</dd></dl>

</div>
<span class="target" id="module-on.corpora.parallel"></span><div class="section" id="parallel-alignment-metadata-for-parallel-texts">
<h2><tt class="xref py py-mod docutils literal"><span class="pre">parallel</span></tt> &#8211; Alignment Metadata for Parallel Texts<a class="headerlink" href="#parallel-alignment-metadata-for-parallel-texts" title="Permalink to this headline">¶</a></h2>
<p>See:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#on.corpora.parallel.parallel_sentence" title="on.corpora.parallel.parallel_sentence"><tt class="xref py py-class docutils literal"><span class="pre">parallel_sentence</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.parallel.parallel_document" title="on.corpora.parallel.parallel_document"><tt class="xref py py-class docutils literal"><span class="pre">parallel_document</span></tt></a></li>
<li><a class="reference internal" href="#on.corpora.parallel.parallel_bank" title="on.corpora.parallel.parallel_bank"><tt class="xref py py-class docutils literal"><span class="pre">parallel_bank</span></tt></a></li>
</ul>
</div></blockquote>
<p>Correspondences:</p>
<blockquote>
<div><table border="1" class="docutils">
<colgroup>
<col width="18%" />
<col width="36%" />
<col width="46%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head"><strong>Database Tables</strong></th>
<th class="head"><strong>Python Objects</strong></th>
<th class="head"><strong>File Elements</strong></th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>None</td>
<td><a class="reference internal" href="#on.corpora.parallel.parallel_bank" title="on.corpora.parallel.parallel_bank"><tt class="xref py py-class docutils literal"><span class="pre">parallel_bank</span></tt></a></td>
<td>All <tt class="docutils literal"><span class="pre">.parallel</span></tt> files in an <a class="reference internal" href="#on.corpora.subcorpus" title="on.corpora.subcorpus"><tt class="xref py py-class docutils literal"><span class="pre">on.corpora.subcorpus</span></tt></a></td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">parallel_document</span></tt></td>
<td><a class="reference internal" href="#on.corpora.parallel.parallel_document" title="on.corpora.parallel.parallel_document"><tt class="xref py py-class docutils literal"><span class="pre">parallel_document</span></tt></a></td>
<td>The second line (original/translation line) in a <tt class="docutils literal"><span class="pre">.parallel</span></tt> file</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">parallel_sentence</span></tt></td>
<td><a class="reference internal" href="#on.corpora.parallel.parallel_sentence" title="on.corpora.parallel.parallel_sentence"><tt class="xref py py-class docutils literal"><span class="pre">parallel_sentence</span></tt></a></td>
<td>All lines in a <tt class="docutils literal"><span class="pre">.parallel</span></tt> file after the first two (map lines)</td>
</tr>
</tbody>
</table>
</div></blockquote>
<dl class="class">
<dt id="on.corpora.parallel.parallel_bank">
<em class="property">class </em><tt class="descclassname">on.corpora.parallel.</tt><tt class="descname">parallel_bank</tt><big>(</big><em>a_subcorpus</em>, <em>tag</em>, <em>a_cursor=None</em>, <em>extension='parallel'</em><big>)</big><a class="headerlink" href="#on.corpora.parallel.parallel_bank" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="class">
<dt id="on.corpora.parallel.parallel_document">
<em class="property">class </em><tt class="descclassname">on.corpora.parallel.</tt><tt class="descname">parallel_document</tt><big>(</big><em>id_original</em>, <em>id_translation</em>, <em>extension='parallel'</em><big>)</big><a class="headerlink" href="#on.corpora.parallel.parallel_document" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="class">
<dt id="on.corpora.parallel.parallel_sentence">
<em class="property">class </em><tt class="descclassname">on.corpora.parallel.</tt><tt class="descname">parallel_sentence</tt><big>(</big><em>id_original</em>, <em>id_translation</em><big>)</big><a class="headerlink" href="#on.corpora.parallel.parallel_sentence" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#"><tt class="docutils literal"><span class="pre">on.corpora</span></tt> &#8211; classes for interpreting annotation</a><ul>
<li><a class="reference internal" href="#tree-syntactic-parse-annotation"><tt class="docutils literal"><span class="pre">tree</span></tt> &#8211; Syntactic Parse Annotation</a></li>
<li><a class="reference internal" href="#proposition-proposition-annotation"><tt class="docutils literal"><span class="pre">proposition</span></tt> &#8211; Proposition Annotation</a></li>
<li><a class="reference internal" href="#sense-word-sense-annotation"><tt class="docutils literal"><span class="pre">sense</span></tt> &#8211; Word Sense Annotation</a></li>
<li><a class="reference internal" href="#coreference-coreferential-entity-annotation"><tt class="docutils literal"><span class="pre">coreference</span></tt> &#8211; Coreferential Entity Annotation</a></li>
<li><a class="reference internal" href="#name-name-entity-annotation"><tt class="docutils literal"><span class="pre">name</span></tt> &#8211; Name-Entity Annotation</a></li>
<li><a class="reference internal" href="#ontology-ontology-annotation"><tt class="docutils literal"><span class="pre">ontology</span></tt> &#8211; Ontology Annotation</a></li>
<li><a class="reference internal" href="#speaker-speaker-metadata-for-broadcast-conversation-documents"><tt class="docutils literal"><span class="pre">speaker</span></tt> &#8211; Speaker Metadata for Broadcast Conversation Documents</a></li>
<li><a class="reference internal" href="#parallel-alignment-metadata-for-parallel-texts"><tt class="docutils literal"><span class="pre">parallel</span></tt> &#8211; Alignment Metadata for Parallel Texts</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="common.html"
                        title="previous chapter"><tt class="docutils literal docutils literal docutils literal"><span class="pre">on.common</span></tt> &#8211; Utility and Logging Functions</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="tools.html"
                        title="next chapter"><tt class="docutils literal"><span class="pre">on.tools</span></tt> &#8211; scripts for manipulating the ontonotes data</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/corpora.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="tools.html" title="on.tools – scripts for manipulating the ontonotes data"
             >next</a> |</li>
        <li class="right" >
          <a href="common.html" title="on.common – Utility and Logging Functions"
             >previous</a> |</li>
        <li><a href="index.html">OntoNotes DB Tool 0.999b documentation</a> &raquo;</li>
          <li><a href="API_reference.html" >API Reference</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 20011, BBN Technologies.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>